Easy Property Listings 3.5.25 Code Reference
  • Package
  • Class
  • Tree
  • Todo
  • Hook Reference

Packages

  • EPL
    • Admin
      • Actions
      • Classes
        • ContactsTable
        • EPL
          • Admin
            • Images
        • ReportsGraph
        • Welcome
      • Contacts
      • ContactsActions
      • ContactsFunctions
      • Elements
      • Functions
      • Help
      • HelpSingle
      • Menus
      • MenusAddons
      • MenusExtensions
      • MenusLicenses
      • Plugins
      • Reports
      • ReportsGraphing
      • User
    • Assets
      • ScriptsStyles
      • SVG
    • Classes
      • AuthorLoader
      • AuthorMeta
      • Contact
      • Cron
      • CustomPostType
      • Forms
      • License
      • ListingAdvanced
      • ListingElements
      • MetaboxesCustomFields
      • Pagination
      • PropertyMeta
      • RenderFields
      • RestAPI
      • Search
      • Session
      • Updater
    • Compatibility
      • Extensions
      • Functions
      • Shortcodes
    • Functions
      • Actions
      • ConditionalTags
      • ErrorTracking
      • Formatting
      • Front
      • Global
      • Install
      • Pagination
      • Settings
      • Templates
    • Hooks
      • EnergyCertificate
      • ExternalLinks
      • FloorPlan
      • Map
      • ReadMore
      • WebLink
    • Includes
      • UserMeta
    • Meta
      • InitCustomFields
      • Meta
    • PostTypes
      • Business
      • Commercial
      • CommercialLand
      • Contact
      • Functions
      • Land
      • Property
      • Rental
      • Rural
    • Shortcode
      • CommercialListingSearch
      • ContactForm
      • Listing
      • ListingAdvanced
      • ListingAuction
      • ListingCategory
      • ListingFeature
      • ListingLocation
      • ListingMetaDoc
      • ListingOpen
      • ListingResults
      • ListingSearch
      • Map
    • Taxonomy
      • BusinessCategories
      • ContactTag
      • Features
      • Location
    • Templates
      • Themes
        • iThemes
        • iThemesBuilder
    • Widget
      • Admin
        • Dashboard
      • Classes
        • Author
        • ContactCapture
        • Gallery
        • Listing
        • Search
      • Functions
  • None
  • WordPress
    • Session

Classes

  • EPL_Admin_Images
  • EPL_Advanced_Shortcode_Listing
  • EPL_Author
  • EPL_Author_Loader
  • EPL_Author_Meta
  • EPL_Contact
  • EPL_Contact_Reports_Table
  • EPL_CPT
  • EPL_Cron
  • EPL_FORM_BUILDER
  • EPL_Graph
  • EPL_License
  • EPL_Listing_Elements
  • EPL_METABOX
  • EPL_Pagination_Call
  • EPL_Property_Meta
  • EPL_Render_Fields
  • EPL_Rest_API
  • EPL_SEARCH
  • EPL_Search_Fields
  • EPL_Session
  • EPL_SL_Plugin_Updater
  • EPL_Welcome
  • EPL_Widget_Author
  • EPL_Widget_Contact_Capture
  • EPL_Widget_Property_Gallery
  • EPL_Widget_Property_Search
  • EPL_Widget_Recent_Property

Functions

  • EPL
   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45   46   47   48   49   50   51   52   53   54   55   56   57   58   59   60   61   62   63   64   65   66   67   68   69   70   71   72   73   74   75   76   77   78   79   80   81   82   83   84   85   86   87   88   89   90   91   92   93   94   95   96   97   98   99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210  211  212  213  214  215  216  217  218  219  220  221  222  223  224  225  226  227  228  229  230  231  232  233  234  235  236  237  238  239  240  241  242  243  244  245  246  247  248  249  250  251  252  253  254  255  256  257  258  259  260  261  262  263  264  265  266  267  268  269  270  271  272  273  274  275  276  277  278  279  280  281  282  283  284  285  286  287  288  289  290  291  292  293  294  295  296  297  298  299  300  301  302  303  304  305  306  307  308  309  310  311  312  313  314  315  316  317  318  319  320  321  322  323  324  325  326  327  328  329  330  331  332  333  334  335  336  337  338  339  340  341  342  343  344  345  346  347  348  349  350  351  352  353  354  355  356  357  358  359  360  361  362  363  364  365  366  367  368  369  370  371  372  373  374  375  376  377  378  379  380  381  382  383  384  385  386  387  388  389  390  391  392  393  394  395  396  397  398  399  400  401  402  403  404  405  406  407  408  409  410  411  412  413  414  415  416  417  418  419  420  421  422  423  424  425  426  427  428  429  430  431  432  433  434  435  436  437  438  439  440  441  442  443  444  445  446  447  448  449  450  451  452  453  454  455  456  457  458  459  460  461  462  463  464  465  466  467  468  469  470  471  472  473  474  475  476  477  478  479  480  481  482  483  484  485  486  487  488  489  490  491  492  493  494  495  496  497  498  499  500  501  502  503  504  505  506  507  508  509  510  511  512  513  514  515  516  517  518  519  520  521  522  523  524  525  526  527  528  529  530  531  532  533  534  535  536  537  538  539  540  541  542  543  544  545  546  547  548  549  550  551  552  553  554  555  556  557  558  559  560  561  562  563  564  565  566  567  568  569  570  571  572  573  574  575  576  577  578  579  580  581  582  583  584  585  586  587  588  589  590  591  592  593  594  595  596  597  598  599  600  601  602  603  604  605  606  607  608  609  610  611  612  613  614  615  616  617  618  619  620  621  622  623  624  625  626  627  628  629  630  631  632  633  634  635  636  637  638  639  640  641  642  643  644  645  646  647  648  649  650  651  652  653  654  655  656  657  658  659  660  661  662  663  664  665  666  667  668  669  670  671  672  673  674  675  676  677  678  679  680  681  682  683  684  685  686  687  688  689  690  691  692  693  694  695  696  697  698  699  700  701  702  703  704  705  706  707  708  709  710  711  712  713  714  715  716  717  718  719  720  721  722  723  724  725  726  727  728  729  730  731  732  733  734  735  736  737  738  739  740  741  742  743  744  745  746  747  748  749  750  751  752  753  754  755  756  757  758  759  760  761  762  763  764  765  766  767  768  769  770  771  772  773  774  775  776  777  778  779  780  781  782  783  784  785  786  787  788  789  790  791  792  793  794  795  796  797  798  799  800  801  802  803  804  805  806  807  808  809  810  811  812  813  814  815  816  817  818  819  820  821  822  823  824  825  826  827  828  829  830  831  832  833  834  835  836  837  838  839  840  841  842  843  844  845  846  847  848  849  850  851  852  853  854  855  856  857  858  859  860  861  862  863  864  865  866  867  868  869  870  871  872  873  874  875  876  877  878  879  880  881  882  883  884  885  886  887  888  889  890  891  892  893  894  895  896  897  898  899  900  901  902  903  904  905  906  907  908  909  910  911  912  913  914  915  916  917  918  919  920  921  922  923  924  925  926  927  928  929  930  931  932  933  934  935  936  937  938  939  940  941  942  943  944  945  946  947  948  949  950  951  952  953  954  955  956  957  958  959  960  961  962  963  964  965  966  967  968  969  970  971  972  973  974  975  976  977  978  979  980  981  982  983  984  985  986  987  988  989  990  991  992  993  994  995  996  997  998  999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 
<?php
/**
 * EPL Author Class. Allows for overriding.
 *
 * @package     EPL
 * @subpackage  Classes/AuthorMeta
 * @copyright   Copyright (c) 2022, Merv Barrett
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since       1.3.0
 * @since       3.4.39 Allows for overriding.
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * EPL_Author Class
 *
 * @since 1.3.0
 */
if ( ! class_exists( 'EPL_Author' ) ) :

    /**
     * EPL_Author Class
     *
     * @since 1.3.0
     */
    class EPL_Author {

        /**
         * The user ID
         *
         * @since 1.3.0
         * @var string $author_id User ID.
         */
        public $author_id;

        /**
         * The username
         *
         * @since 1.3.0
         * @var string $name User name.
         */
        public $name;

        /**
         * The user mobile phone number
         *
         * @since 1.3.0
         * @var string $mobile User mobile number.
         */
        public $mobile;

        /**
         * The user office phone number
         *
         * @since 3.3.0
         * @var string $office_phone User office phone.
         */
        public $office_phone;

        /**
         * The user website
         *
         * @since 3.5.15
         * @var string $website User website.
         */
        public $website;

        /**
         * The user Facebook URL
         *
         * @since 1.3.0
         * @var string $facebook User Facebook profile URL.
         */
        public $facebook;

        /**
         * The user LinkedIn URL
         *
         * @since 1.3.0
         * @var string $linkedin User LinkedIn profile URL.
         */
        public $linkedin;

        /**
         * The user Google Plus URL
         *
         * @since 1.3.0
         * @var string $google User Google Plus profile URL.
         */
        public $google;

        /**
         * The user Twitter URL
         *
         * @since 1.3.0
         * @var string $twitter User Twitter ID.
         */
        public $twitter;

        /**
         * The user Instagram URL
         *
         * @since 3.3.0
         * @var string $instagram User Instagram profile URL.
         */
        public $instagram;

        /**
         * The user Pinterest URL
         *
         * @since 3.3.0
         * @var string $pinterest User Pinterest profile URL.
         */
        public $pinterest;

        /**
         * The user YouTube URL
         *
         * @since 3.3.0
         * @var string $youtube User YouTube profile URL.
         */
        public $youtube;

        /**
         * The user email address
         *
         * @since 1.3.0
         * @var string $email User email address.
         */
        public $email;

        /**
         * The user Skype name
         *
         * @since 1.3.0
         * @var string $skype User Skype ID.
         */
        public $skype;

        /**
         * The user text slogan
         *
         * @since 1.3.0
         * @var string $slogan User Slogan text string.
         */
        public $slogan;

        /**
         * The user position
         *
         * @since 1.3.0
         * @var string $position User position text string.
         */
        public $position;

        /**
         * The user video profile
         *
         * @since 1.3.0
         * @var string $video User video profile URL.
         */
        public $video;

        /**
         * The user contact form shortcode
         *
         * @since 1.3.0
         * @var string $contact_form User contact shortcode.
         */
        public $contact_form;

        /**
         * The user bio
         *
         * @since 1.3.0
         * @var string $description User bio textarea.
         */
        public $description;

        /**
         * Get things started
         *
         * @param string $author_id The author WordPress user ID.
         *
         * @since 1.3.0
         * @since 3.5.15 Added website (url)
         */
        public function __construct( $author_id ) {
            $this->author_id    = $author_id;
            $this->name         = get_the_author_meta( 'display_name', $this->author_id );
            $this->mobile       = get_the_author_meta( 'mobile', $this->author_id );
            $this->office_phone = get_the_author_meta( 'office_phone', $this->author_id );
            $this->website      = get_the_author_meta( 'url', $this->author_id );
            $this->facebook     = get_the_author_meta( 'facebook', $this->author_id );
            $this->linkedin     = get_the_author_meta( 'linkedin', $this->author_id );
            $this->google       = get_the_author_meta( 'google', $this->author_id );
            $this->twitter      = get_the_author_meta( 'twitter', $this->author_id );
            $this->instagram    = get_the_author_meta( 'instagram', $this->author_id );
            $this->pinterest    = get_the_author_meta( 'pinterest', $this->author_id );
            $this->youtube      = get_the_author_meta( 'youtube', $this->author_id );
            $this->email        = get_the_author_meta( 'email', $this->author_id );
            $this->skype        = get_the_author_meta( 'skype', $this->author_id );
            $this->slogan       = get_the_author_meta( 'slogan', $this->author_id );
            $this->position     = get_the_author_meta( 'position', $this->author_id );
            $this->video        = get_the_author_meta( 'video', $this->author_id );
            $this->contact_form = get_the_author_meta( 'contact-form', $this->author_id );
            $this->description  = get_the_author_meta( 'description', $this->author_id );
        }

        /**
         * Get the global property object
         *
         * @param string $property Name of the property to retrieve.
         *
         * @return bool|mixed $return Array of values.
         * @since 1.3.0
         */
        public function __get( $property ) {
            $prop_val  = ! empty( $this->{$property} ) ? $this->{$property} : false;
            $prop_meta = get_user_meta( $this->author_id, $property, true );

            if ( ! empty( $prop_val ) ) {
                return $prop_val;

            } elseif ( ! empty( $prop_meta ) ) {
                return $prop_meta;
            }
        }

        /**
         * Author Name
         *
         * @since 1.3.0
         */
        public function get_author_name() {
            if ( ! empty( $this->name ) ) {
                return apply_filters( 'epl_author_name', $this->name, $this );
            }
        }

        /**
         * Get Email
         *
         * @since 3.2.0
         */
        public function get_email() {
            if ( ! empty( $this->email ) ) {
                return apply_filters( 'epl_author_email', $this->email, $this );
            }
        }

        /**
         * Escape a social/contact profile URL for use in an href attribute.
         *
         * Non http(s) schemes used by the contact methods (mailto, skype, tel) are
         * whitelisted explicitly, everything else falls back to the WordPress
         * allowed protocol list. Values that sanitise away to nothing are returned
         * as an empty string so the caller can skip rendering the link entirely.
         *
         * @param string $url The raw profile URL.
         *
         * @return string
         * @since 3.5.25
         */
        protected function esc_profile_url( $url ) {

            if ( ! is_string( $url ) || '' === $url ) {
                return '';
            }

            $protocols = function_exists( 'epl_get_profile_link_protocols' )
                ? epl_get_profile_link_protocols()
                : array_values( array_unique( array_merge( wp_allowed_protocols(), array( 'skype' ) ) ) );

            return esc_url( $url, $protocols );
        }

        /**
         * Build an escaped title attribute for a contact icon.
         *
         * @param string $prefix Leading label, eg. "Follow".
         * @param string $suffix Trailing label, eg. "on Facebook".
         *
         * @return string
         * @since 3.5.25
         */
        protected function get_icon_title( $prefix, $suffix ) {
            return esc_attr( $prefix . ' ' . $this->get_author_name() . ' ' . $suffix );
        }

        /**
         * Author Email html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 1.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_email_html( $html = '', $style = 'i' ) {

            $href = esc_url( 'mailto:' . $this->get_email(), array( 'mailto' ) );

            if ( ! empty( $this->email ) && '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Contact', 'easy-property-listings' ), __( 'by Email', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon email-icon-24"
                            href="' . $href . '" title="' . $title . '">' .
                            apply_filters( 'epl_author_icon_email', __( 'Email', 'easy-property-listings' ) ) .
                            '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-email"><use xlink:href="#epl-icon-svg-email"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-email">
                            <a class="epl-author-icon-svg author-icon-svg email-icon"
                                href="' . $href . '" title="' . $title . '">' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_email_html', $html, $this );
            return $html;
        }

        /**
         * Get website
         *
         * @since 3.5.15
         */
        public function get_website() {
            if ( ! empty( $this->website ) ) {
                return apply_filters( 'epl_author_website', $this->website, $this );
            }
        }

        /**
         * Author website html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         *
         * @since 3.5.15
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_website_html( $html = '', $style = 'i' ) {

            $href = $this->esc_profile_url( $this->get_website() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Contact', 'easy-property-listings' ), __( 'by Website', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon website-icon-24"
                            href="' . $href . '" title="' . $title . '">' .
                            apply_filters( 'epl_author_icon_website', __( 'Website', 'easy-property-listings' ) ) .
                            '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-website"><use xlink:href="#epl-icon-svg-website"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-website">
                            <a class="epl-author-icon-svg author-icon-svg website-icon"
                                href="' . $href . '" title="' . $title . '">' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_website_html', $html, $this );
            return $html;
        }

        /**
         * Get Twitter
         *
         * @since 3.2.0
         */
        public function get_twitter() {

            $twitter = '';
            if ( ! empty( $this->twitter ) ) {

                if ( ( strpos( $this->twitter, 'http://' ) === 0 ) || ( strpos( $this->twitter, 'https://' ) === 0 ) ) {
                    // Absolute url.
                    $twitter = $this->twitter;

                } else {
                    // Relative url.
                    $twitter = 'http://twitter.com/' . $this->twitter;
                }
            }
            return apply_filters( 'epl_author_twitter', $twitter, $this );
        }

        /**
         * Get Instagram
         *
         * @since 3.3.0
         */
        public function get_instagram() {

            $instagram = '';
            if ( ! empty( $this->instagram ) ) {

                if ( ( strpos( $this->instagram, 'http://' ) === 0 ) || ( strpos( $this->instagram, 'https://' ) === 0 ) ) {
                    // Absolute url.
                    $instagram = $this->instagram;

                } else {
                    // Relative url.
                    $instagram = 'http://instagram.com/' . $this->instagram;
                }
            }
            return apply_filters( 'epl_author_instagram', $instagram, $this );
        }

        /**
         * Get YouTube
         *
         * @since 3.3.0
         */
        public function get_youtube() {

            $youtube = '';
            if ( ! empty( $this->youtube ) ) {

                if ( ( strpos( $this->youtube, 'http://' ) === 0 ) || ( strpos( $this->youtube, 'https://' ) === 0 ) ) {
                    // Absolute url.
                    $youtube = $this->youtube;

                } else {
                    // Relative url.
                    $youtube = 'http://youtube.com/' . $this->youtube;
                }
            }
            return apply_filters( 'epl_author_youtube', $youtube, $this );
        }

        /**
         * Get Pinterest
         *
         * @since 3.3.0
         */
        public function get_pinterest() {

            $pinterest = '';
            if ( ! empty( $this->pinterest ) ) {

                if ( ( strpos( $this->pinterest, 'http://' ) === 0 ) || ( strpos( $this->pinterest, 'https://' ) === 0 ) ) {
                    // Absolute url.
                    $pinterest = $this->pinterest;

                } else {
                    // Relative url.
                    $pinterest = 'http://pinterest.com/' . $this->pinterest;
                }
            }
            return apply_filters( 'epl_author_pinterest', $pinterest, $this );
        }

        /**
         * Author Twitter html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 1.3.0
         * @since 3.5.0 Switched to Twitter X icon.
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_twitter_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_twitter() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Twitter', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon twitter-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_twitter', __( 'Twitter', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-twitter-x"><use xlink:href="#epl-icon-svg-twitter-x"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-twitter">
                            <a class="epl-author-icon-svg author-icon-svg twitter-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_twitter_html', $html, $this );
            return $html;
        }

        /**
         * Author Instagram html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 3.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_instagram_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_instagram() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Instagram', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon instagram-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_instagram', __( 'Instagram', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-instagram"><use xlink:href="#epl-icon-svg-instagram"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-instagram">
                            <a class="epl-author-icon-svg author-icon-svg instagram-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_instagram_html', $html, $this );
            return $html;
        }

        /**
         * Author YouTube html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 3.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_youtube_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_youtube() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on YouTube', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon youtube-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_youtube', __( 'YouTube', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-youtube"><use xlink:href="#epl-icon-svg-youtube"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-youtube">
                            <a class="epl-author-icon-svg author-icon-svg youtube-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_youtube_html', $html, $this );
            return $html;
        }

        /**
         * Author Pinterest html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 3.3.0
         * @since 3.5.25 Escaped the href and title attributes. Fixed the SVG variant linking to Instagram.
         */
        public function get_pinterest_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_pinterest() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Pinterest', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon pinterest-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_pinterest', __( 'Pinterest', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-pinterest"><use xlink:href="#epl-icon-svg-pinterest"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-pinterest">
                            <a class="epl-author-icon-svg author-icon-svg pinterest-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_pinterest_html', $html, $this );
            return $html;
        }

        /**
         * Get Google
         *
         * @since 3.2.0
         * @since 3.3.0 Depreciated as Google Plus no longer exists.
         */
        public function get_google() {

            $google = '';
            if ( ! empty( $this->google ) ) {

                if ( ( strpos( $this->google, 'http://' ) === 0 ) || ( strpos( $this->google, 'https://' ) === 0 ) ) {
                    // absolute url.
                    $google = $this->google;

                } else {
                    // relative url.
                    $google = 'http://plus.google.com/' . $this->google;
                }
            }
            return apply_filters( 'epl_author_google', $google, $this );
        }

        /**
         * Author Google html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         *
         * @since 1.3.0
         * @since 3.3.0 Depreciated as Google Plus no longer exists.
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_google_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_google() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Google', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon google-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_google', __( 'Google', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-google-plus"><use xlink:href="#epl-icon-svg-google-plus"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-google-plus">
                            <a class="epl-author-icon-svg author-icon-svg google-plus-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_google_html', $html, $this );
            return $html;
        }

        /**
         * Get Facebook
         *
         * @since 3.2.0
         */
        public function get_facebook() {

            $facebook = '';

            if ( ! empty( $this->facebook ) ) {

                if ( ( strpos( $this->facebook, 'http://' ) === 0 ) || ( strpos( $this->facebook, 'https://' ) === 0 ) ) {
                    // absolute url.
                    $facebook = $this->facebook;

                } else {
                    // relative url.
                    $facebook = 'http://facebook.com/' . $this->facebook;
                }
            }
            return apply_filters( 'epl_author_facebook', $facebook, $this );
        }

        /**
         * Author Facebook html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 1.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_facebook_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_facebook() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Facebook', 'easy-property-listings' ) );

                if ( 'i' === $style ) {
                    $html = '
                        <a class="epl-author-icon author-icon facebook-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_facebook', __( 'Facebook', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-facebook"><use xlink:href="#epl-icon-svg-facebook"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-facebook">
                            <a class="epl-author-icon-svg author-icon-svg facebook-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_facebook_html', $html, $this );
            return $html;
        }

        /**
         * Get linkedin
         *
         * @since 3.2.0
         */
        public function get_linkedin() {

            $linkedin = '';

            if ( ! empty( $this->linkedin ) ) {

                if ( ( strpos( $this->linkedin, 'http://' ) === 0 ) || ( strpos( $this->linkedin, 'https://' ) === 0 ) ) {
                    // absolute url.
                    $linkedin = $this->linkedin;

                } else {
                    // relative url.
                    $linkedin = 'http://linkedin.com/pub/' . $this->linkedin;
                }
            }
            return apply_filters( 'epl_author_linkedin', $linkedin, $this );
        }

        /**
         * Author LinkedIn html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 1.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_linkedin_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_linkedin() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on LinkedIn', 'easy-property-listings' ) );

                if ( 'i' === $style ) {

                    $html = '
                        <a class="epl-author-icon author-icon linkedin-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_linkedin', __( 'LinkedIn', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-linkedin"><use xlink:href="#epl-icon-svg-linkedin"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-linkedin">
                            <a class="epl-author-icon-svg author-icon-svg linkedin-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_linkedin_html', $html, $this );
            return $html;
        }

        /**
         * Get skype
         *
         * @since 3.2.0
         */
        public function get_skype() {

            $skype = '';
            if ( ! empty( $this->skype ) ) {

                if ( ( strpos( $this->skype, 'skype:' ) === 0 ) ) {
                    // Absolute url.
                    $skype = $this->skype;

                } else {
                    // Relative url.
                    $skype = 'skype:' . $this->skype;
                }
            }
            return apply_filters( 'epl_author_skype', $skype, $this );
        }

        /**
         * Author Skype html Box
         *
         * @param string $html String of html.
         * @param string $style Option of returntype.
         *
         * @return mixed|string|void
         * @since 1.3.0
         * @since 3.5.25 Escaped the href and title attributes.
         */
        public function get_skype_html( $html = '', $style = 'i' ) {

            $link_target = defined( 'EPL_SOCIAL_LINK_TARGET_BLANK' ) && EPL_SOCIAL_LINK_TARGET_BLANK ? 'target="_blank" ' : '';

            $href = $this->esc_profile_url( $this->get_skype() );

            if ( '' !== $href ) {

                $style = 'i' === $style && 'on' === epl_get_option( 'epl_icons_svg_author' ) ? 's' : $style;
                $title = $this->get_icon_title( __( 'Follow', 'easy-property-listings' ), __( 'on Skype', 'easy-property-listings' ) );

                if ( 'i' === $style ) {

                    $html = '
                        <a class="epl-author-icon author-icon skype-icon-24"
                            href="' . $href . '" title="' . $title . '"' . $link_target . '>' .
                            apply_filters( 'epl_author_icon_skype', __( 'Skype', 'easy-property-listings' ) ) .
                        '</a>';
                } else {
                    $svg  = '<svg viewBox="0 0 100 100" class="epl-icon-svg-skype"><use xlink:href="#epl-icon-svg-skype"></use></svg>';
                    $html =
                        '<div class="epl-icon-svg-container epl-icon-container-skype">
                            <a class="epl-author-icon-svg author-icon-svg skype-icon"
                                href="' . $href . '" title="' . $title . '"' . $link_target . '>' . $svg .
                            '</a>
                        </div>';
                }
            }
            $html = apply_filters( 'epl_author_skype_html', $html, $this );
            return $html;
        }

        /**
         * Author video html Box
         *
         * @param string $html String of video embed.
         *
         * @return mixed|void
         * @since 1.3.0
         * @since 3.5.25 The profile video URL is sanitised before it is embedded.
         */
        public function get_video_html( $html = '' ) {
            if ( ! empty( $this->video ) ) {
                $video = apply_filters( 'epl_author_video_html', $this->video, $this );
                $video = esc_url_raw( $video, array( 'http', 'https' ) );

                if ( '' !== $video ) {
                    $html = wp_oembed_get( $video );
                }
            }
            return apply_filters( 'epl_author_video', $html, $this );
        }

        /**
         * Get description
         *
         * @since 3.2.0
         */
        public function get_description() {
            if ( ! empty( $this->description ) ) {
                return apply_filters( 'epl_author_description', $this->description, $this );
            }
        }

        /**
         * Author description html
         *
         * @param string $html String of html output.
         *
         * @return mixed|void
         * @since 1.3.0
         * @since 3.5.25 The bio is run through wp_kses_post() and the permalink through esc_url().
         */
        public function get_description_html( $html = '' ) {

            $desc_html = $this->get_description();

            if ( ! empty( $desc_html ) ) {

                $permalink = apply_filters( 'epl_author_profile_link', get_author_posts_url( $this->author_id ), $this );

                $html = '
                <div class="epl-author-content author-content">' . wp_kses_post( $desc_html ) . '</div>
                    <span class="bio-more">
                        <a href="' . esc_url( $permalink ) . '">' .
                            apply_filters( 'epl_author_read_more_label', __( 'Read More', 'easy-property-listings' ) ) . '
                        </a>
                    </span>
            ';
            }
            return apply_filters( 'epl_author_description_html', $html, $this );
        }

        /**
         * Author mobile
         *
         * @since 1.3.0
         */
        public function get_author_mobile() {
            if ( ! empty( $this->mobile ) ) {
                return apply_filters( 'epl_author_mobile', $this->mobile, $this );
            }
        }

        /**
         * Author office phone
         *
         * @since 3.3.0
         */
        public function get_author_office_phone() {
            if ( ! empty( $this->office_phone ) ) {
                return apply_filters( 'epl_author_office_phone', $this->office_phone, $this );
            }
        }

        /**
         * Author ID
         *
         * @since 1.3.0
         */
        public function get_author_id() {
            if ( ! empty( $this->author_id ) ) {
                return apply_filters( 'epl_author_id', $this->author_id, $this );
            }
        }

        /**
         * Author Slogan
         *
         * @since 1.3.0
         */
        public function get_author_slogan() {
            if ( ! empty( $this->slogan ) ) {
                return apply_filters( 'epl_author_slogan', $this->slogan, $this );
            }
        }

        /**
         * Author Position
         *
         * @since 1.3.0
         */
        public function get_author_position() {
            if ( ! empty( $this->position ) ) {
                return apply_filters( 'epl_author_position', $this->position, $this );
            }
        }

        /**
         * Author Contact Form
         *
         * @since 1.3.0
         */
        public function get_author_contact_form() {
            if ( ! empty( $this->contact_form ) ) {
                $contact_form = apply_filters( 'epl_author_contact_form', $this->contact_form, $this );
                return do_shortcode( $contact_form );
            }
        }
    }
endif;
Easy Property Listings 3.5.25 Code Reference API documentation generated by ApiGen