'' !== $name ? $name : get_bloginfo( 'name' ), 'nmls' => (string) get_option( 'mapp_company_nmls', '' ), 'phone' => (string) get_option( 'mapp_company_phone', '' ), ); } /** * Consent text with company and LO names filled in. * * @param string $key consent_tcpa | agree_access | full_certify. * @param int|null $id Application ID (for its LO and language). * @param string $lang Language when no application. * @param int $lo_id LO when no application. * @return string */ public static function consent_text( $key, $id = null, $lang = 'en', $lo_id = 0 ) { $def = Schema::question( $key ); if ( ! $def ) { return ''; } if ( $id ) { $lang = 'es' === get_post_meta( $id, 'mapp_lang', true ) ? 'es' : 'en'; $lo_id = (int) get_post_meta( $id, 'mapp_lo_id', true ); } $lo = LoanOfficers::profile( $lo_id ); $company = self::company(); $text = strtr( Schema::text( $def['label'], $lang ), array( '{company}' => $company['name'], '{lo_name}' => $lo ? $lo['name'] : ( 'es' === $lang ? 'sus oficiales de préstamos' : 'its loan officers' ), ) ); if ( ! empty( $def['terms_option'] ) && function_exists( 'get_front_mortgage_application_option' ) ) { $terms = wp_strip_all_tags( (string) get_front_mortgage_application_option( $def['terms_option'] ) ); if ( '' !== $terms ) { $text .= ' ' . $terms; } else { // Same wording the form shows when no terms are set. $text = preg_replace( '/,? (and I agree to the terms below|y acepto los términos a continuación)/u', '', $text ); } } return $text; } }