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