args = $args; } /** * Output the query result * * @return string The HTML result */ public function output() { ob_start(); require( \ItalyStrap\Core\get_template( 'templates/content-vcard.php' ) ); $output = ob_get_contents(); ob_end_clean(); return $output; } /** * Get the company name * * @param bool $echo Echo it if is true. * * @return string If echo is false return */ public function get_company_name( $echo = false ) { $company_name = ''; if ( $this->args['company_name'] ) { $company_name = esc_textarea( $this->args['company_name'] ); } else { $company_name = get_bloginfo( 'name' ); } if ( $echo ) { echo $company_name; // XSS ok. } else { return $company_name; } } /** * Get itemprop sameAs * * @param bool $echo Echo it if is true. * * @return string If echo is false return */ public function get_itemprop_sameas( $echo = false ) { $same_as = array( 'facebook', 'twitter', 'googleplus', 'pinterest', 'instagram', 'youtube', 'linkedin', ); $meta = ''; foreach ( $same_as as $social ) { if ( $this->args[ $social ] ) { $meta .= ''; } } if ( $echo ) { echo $meta; // XSS ok. } else { return $meta; } } /** * Get itemprop contacts * * @param bool $echo Echo it if is true. * * @return string If echo is false return */ public function get_itemprop_contacts( $echo = false ) { $contacts = array( 'tel' => 'telephone', 'mobile' => 'telephone', 'fax' => 'faxNumber', 'email' => 'email', 'taxID' => 'taxID', ); $contacts_list = ''; foreach ( $contacts as $contact_key => $itemprop ) { if ( $this->args[ $contact_key ] ) { if ( 'email' === $contact_key ) { $contacts_list .= '