Version Description
- Fixed missing link on avatar
Download this release
Release Info
| Developer | GreenTreeLabs |
| Plugin | |
| Version | 2.3.15 |
| Comparing to | |
| See all releases | |
Code changes from version 2.3.12 to 2.3.15
- assets/css/sabox-admin-style.css +4 -0
- inc/class-simple-author-box-admin-page.php +26 -0
- inc/class-simple-author-box.php +3 -3
- readme.txt +9 -0
- simple-author-box.php +8 -2
- template/template-sab.php +146 -130
assets/css/sabox-admin-style.css
CHANGED
|
@@ -496,6 +496,10 @@ a.upgrade-pro:after {
|
|
| 496 |
/*color: red !important;*/
|
| 497 |
display: none !important;
|
| 498 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
|
| 500 |
/*.wp-has-submenu a[href*="admin.php?page=sab-upgrade"]:after {
|
| 501 |
font-family: 'dashicons';
|
| 496 |
/*color: red !important;*/
|
| 497 |
display: none !important;
|
| 498 |
}
|
| 499 |
+
#adminmenu .wp-has-current-submenu .wp-submenu a[href*="admin.php?page=sab-news"] {
|
| 500 |
+
color:#faff00;
|
| 501 |
+
font-weight: bold;
|
| 502 |
+
}
|
| 503 |
|
| 504 |
/*.wp-has-submenu a[href*="admin.php?page=sab-upgrade"]:after {
|
| 505 |
font-family: 'dashicons';
|
inc/class-simple-author-box-admin-page.php
CHANGED
|
@@ -455,6 +455,7 @@ class Simple_Author_Box_Admin_Page {
|
|
| 455 |
}
|
| 456 |
|
| 457 |
public function menu_page() {
|
|
|
|
| 458 |
add_menu_page( __( 'Simple Author Box', 'saboxplugin' ), __( 'Simple Author', 'saboxplugin' ), 'manage_options', 'simple-author-box-options', array(
|
| 459 |
$this,
|
| 460 |
'setting_page',
|
|
@@ -462,6 +463,11 @@ class Simple_Author_Box_Admin_Page {
|
|
| 462 |
|
| 463 |
$show_upsell = apply_filters( 'sabox_show_upsell', true );
|
| 464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
if ( $show_upsell ) {
|
| 466 |
add_submenu_page( 'simple-author-box-options', __( 'Upgrade to PRO', 'saboxplugin' ), __( 'Upgrade', 'saboxplugin' ), 'manage_options', 'sab-upgrade', array(
|
| 467 |
$this,
|
|
@@ -763,6 +769,26 @@ class Simple_Author_Box_Admin_Page {
|
|
| 763 |
echo '</tr>';
|
| 764 |
}
|
| 765 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 766 |
public function render_pro_page() {
|
| 767 |
|
| 768 |
$features = array(
|
| 455 |
}
|
| 456 |
|
| 457 |
public function menu_page() {
|
| 458 |
+
|
| 459 |
add_menu_page( __( 'Simple Author Box', 'saboxplugin' ), __( 'Simple Author', 'saboxplugin' ), 'manage_options', 'simple-author-box-options', array(
|
| 460 |
$this,
|
| 461 |
'setting_page',
|
| 463 |
|
| 464 |
$show_upsell = apply_filters( 'sabox_show_upsell', true );
|
| 465 |
|
| 466 |
+
add_submenu_page( 'simple-author-box-options', __( 'News', 'saboxplugin' ), __( 'News', 'saboxplugin' ), 'manage_options', 'sab-news', array(
|
| 467 |
+
$this,
|
| 468 |
+
'render_news_page',
|
| 469 |
+
) );
|
| 470 |
+
|
| 471 |
if ( $show_upsell ) {
|
| 472 |
add_submenu_page( 'simple-author-box-options', __( 'Upgrade to PRO', 'saboxplugin' ), __( 'Upgrade', 'saboxplugin' ), 'manage_options', 'sab-upgrade', array(
|
| 473 |
$this,
|
| 769 |
echo '</tr>';
|
| 770 |
}
|
| 771 |
|
| 772 |
+
public function render_news_page() {
|
| 773 |
+
|
| 774 |
+
$plugins = array(
|
| 775 |
+
array(
|
| 776 |
+
"name" => "Gallery Effects",
|
| 777 |
+
"description" => "Add gorgeous hover effects to your native galleries. No shortcode required!",
|
| 778 |
+
"image" => "gallery.jpg",
|
| 779 |
+
"url" => "https://wp-gallery-effects.com/?utm_source=wordpress&utm_medium=banner&utm_campaign=sab"
|
| 780 |
+
),
|
| 781 |
+
array(
|
| 782 |
+
"name" => "Post Snippets",
|
| 783 |
+
"description" => "Create reusable snippets easily. Make your own shortcodes!",
|
| 784 |
+
"image" => "post-snippets.jpg",
|
| 785 |
+
"url" => "https://wordpress.org/plugins/post-snippets/advanced/"
|
| 786 |
+
)
|
| 787 |
+
);
|
| 788 |
+
|
| 789 |
+
include "page-news.php";
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
public function render_pro_page() {
|
| 793 |
|
| 794 |
$features = array(
|
inc/class-simple-author-box.php
CHANGED
|
@@ -75,8 +75,7 @@ class Simple_Author_Box {
|
|
| 75 |
* everything hooked here loads on both front-end & back-end
|
| 76 |
*/
|
| 77 |
add_filter( 'get_avatar', array( $this, 'replace_gravatar_image' ), 10, 6 );
|
| 78 |
-
add_filter( 'amp_post_template_data', array( $this, 'sab_amp_css' ) ); // @since 2.0.7
|
| 79 |
-
|
| 80 |
/**
|
| 81 |
* Only load when we're in the admin panel
|
| 82 |
*/
|
|
@@ -86,6 +85,7 @@ class Simple_Author_Box {
|
|
| 86 |
add_filter( 'user_contactmethods', array( $this, 'add_extra_fields' ) );
|
| 87 |
add_filter( 'plugin_action_links_' . SIMPLE_AUTHOR_BOX_SLUG, array( $this, 'settings_link' ) );
|
| 88 |
}
|
|
|
|
| 89 |
}
|
| 90 |
|
| 91 |
public function initialize_admin() {
|
|
@@ -392,7 +392,7 @@ class Simple_Author_Box {
|
|
| 392 |
|
| 393 |
|
| 394 |
public function show_social_media_icons( $return, $user ) {
|
| 395 |
-
if ( in_array( 'sab-guest-author', (array) $user->roles ) ) {
|
| 396 |
return false;
|
| 397 |
}
|
| 398 |
|
| 75 |
* everything hooked here loads on both front-end & back-end
|
| 76 |
*/
|
| 77 |
add_filter( 'get_avatar', array( $this, 'replace_gravatar_image' ), 10, 6 );
|
| 78 |
+
add_filter( 'amp_post_template_data', array( $this, 'sab_amp_css' ) ); // @since 2.0.7
|
|
|
|
| 79 |
/**
|
| 80 |
* Only load when we're in the admin panel
|
| 81 |
*/
|
| 85 |
add_filter( 'user_contactmethods', array( $this, 'add_extra_fields' ) );
|
| 86 |
add_filter( 'plugin_action_links_' . SIMPLE_AUTHOR_BOX_SLUG, array( $this, 'settings_link' ) );
|
| 87 |
}
|
| 88 |
+
apply_filters( 'get_the_author', 'sab_the_author', 10, 6 );
|
| 89 |
}
|
| 90 |
|
| 91 |
public function initialize_admin() {
|
| 392 |
|
| 393 |
|
| 394 |
public function show_social_media_icons( $return, $user ) {
|
| 395 |
+
if (isset($user->roles) && in_array( 'sab-guest-author', (array) $user->roles ) ) {
|
| 396 |
return false;
|
| 397 |
}
|
| 398 |
|
readme.txt
CHANGED
|
@@ -52,6 +52,15 @@ We are a young team of WordPress aficionados who love building WordPress plugins
|
|
| 52 |
|
| 53 |
== Changelog ==
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
= 2.3.12 =
|
| 56 |
* Fixed: wrong class name issue
|
| 57 |
|
| 52 |
|
| 53 |
== Changelog ==
|
| 54 |
|
| 55 |
+
= 2.3.15 =
|
| 56 |
+
* Fixed missing link on avatar
|
| 57 |
+
|
| 58 |
+
= 2.3.14 =
|
| 59 |
+
* Fixed PHP notice "roles"
|
| 60 |
+
|
| 61 |
+
= 2.3.13 =
|
| 62 |
+
* Fixed visibility issue
|
| 63 |
+
|
| 64 |
= 2.3.12 =
|
| 65 |
* Fixed: wrong class name issue
|
| 66 |
|
simple-author-box.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
/**
|
| 4 |
* Plugin Name: Simple Author Box
|
| 5 |
* Description: Adds a responsive author box with social icons on your posts.
|
| 6 |
-
* Version: 2.3.
|
| 7 |
* Author: GreenTreeLabs
|
| 8 |
* Requires: 4.6 or higher
|
| 9 |
* License: GPLv3 or later
|
|
@@ -40,6 +40,12 @@
|
|
| 40 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 41 |
*
|
| 42 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
if ( function_exists( 'sab_fs' ) ) {
|
| 45 |
sab_fs()->set_basename( false, __FILE__ );
|
|
@@ -88,7 +94,7 @@ if ( function_exists( 'sab_fs' ) ) {
|
|
| 88 |
define( 'SIMPLE_AUTHOR_BOX_PATH', plugin_dir_path( __FILE__ ) );
|
| 89 |
define( 'SIMPLE_AUTHOR_BOX_ASSETS', plugins_url( '/assets/', __FILE__ ) );
|
| 90 |
define( 'SIMPLE_AUTHOR_BOX_SLUG', plugin_basename( __FILE__ ) );
|
| 91 |
-
define( 'SIMPLE_AUTHOR_BOX_VERSION', '2.3.
|
| 92 |
define( 'SIMPLE_AUTHOR_SCRIPT_DEBUG', false );
|
| 93 |
require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box.php';
|
| 94 |
Simple_Author_Box::get_instance();
|
| 3 |
/**
|
| 4 |
* Plugin Name: Simple Author Box
|
| 5 |
* Description: Adds a responsive author box with social icons on your posts.
|
| 6 |
+
* Version: 2.3.15
|
| 7 |
* Author: GreenTreeLabs
|
| 8 |
* Requires: 4.6 or higher
|
| 9 |
* License: GPLv3 or later
|
| 40 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 41 |
*
|
| 42 |
*/
|
| 43 |
+
function sab_the_author( $a, $b, $c )
|
| 44 |
+
{
|
| 45 |
+
var_dump( $a );
|
| 46 |
+
die;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
|
| 50 |
if ( function_exists( 'sab_fs' ) ) {
|
| 51 |
sab_fs()->set_basename( false, __FILE__ );
|
| 94 |
define( 'SIMPLE_AUTHOR_BOX_PATH', plugin_dir_path( __FILE__ ) );
|
| 95 |
define( 'SIMPLE_AUTHOR_BOX_ASSETS', plugins_url( '/assets/', __FILE__ ) );
|
| 96 |
define( 'SIMPLE_AUTHOR_BOX_SLUG', plugin_basename( __FILE__ ) );
|
| 97 |
+
define( 'SIMPLE_AUTHOR_BOX_VERSION', '2.3.15' );
|
| 98 |
define( 'SIMPLE_AUTHOR_SCRIPT_DEBUG', false );
|
| 99 |
require_once SIMPLE_AUTHOR_BOX_PATH . 'inc/class-simple-author-box.php';
|
| 100 |
Simple_Author_Box::get_instance();
|
template/template-sab.php
CHANGED
|
@@ -1,146 +1,162 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
|
|
|
|
| 4 |
} else {
|
| 5 |
-
|
| 6 |
}
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
} else {
|
| 11 |
-
|
| 12 |
}
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
} else {
|
| 17 |
-
|
| 18 |
}
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
} else {
|
| 23 |
-
|
| 24 |
}
|
| 25 |
|
| 26 |
$sab_author_link = sprintf( '<a href="%s" class="vcard author" rel="author" itemprop="url"><span class="fn" itemprop="name">%s</span></a>', esc_url( get_author_posts_url( $sabox_author_id ) ), esc_html( get_the_author_meta( 'display_name', $sabox_author_id ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
$author_description = apply_filters( 'sab_user_description', get_the_author_meta( 'description' ,$sabox_author_id), $sabox_author_id );
|
| 29 |
-
|
| 30 |
-
if ( '' != $author_description || isset($sabox_options['sab_no_description'] ) && '0' == $sabox_options['sab_no_description'] ) { // hide the author box if no description is provided
|
| 31 |
-
|
| 32 |
-
$show_guest_only = ( get_post_meta( get_the_ID(), '_disable_sab_author_here', true ) ) ? get_post_meta( get_the_ID(), '_disable_sab_author_here', true ) : "false";
|
| 33 |
-
|
| 34 |
-
if ( $show_guest_only != "on" ) {
|
| 35 |
-
|
| 36 |
-
echo '<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">'; // start saboxplugin-wrap div
|
| 37 |
-
|
| 38 |
-
// author box gravatar
|
| 39 |
-
echo '<div class="saboxplugin-gravatar">';
|
| 40 |
-
$custom_profile_image = get_the_author_meta( 'sabox-profile-image', $sabox_author_id );
|
| 41 |
-
if ( '' != $custom_profile_image ) {
|
| 42 |
-
$mediaid = attachment_url_to_postid( $custom_profile_image );
|
| 43 |
-
$alt = $mediaid ? get_post_meta( $mediaid, '_wp_attachment_image_alt', true ) : '';
|
| 44 |
-
echo '<img src="' . esc_url( $custom_profile_image ) . '" alt="' . esc_attr( $alt ) . '" itemprop="image">';
|
| 45 |
-
} else {
|
| 46 |
-
echo get_avatar( get_the_author_meta( 'user_email', $sabox_author_id ), '100', '', '', array('extra_attr' => 'itemprop="image"') );
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
echo '</div>';
|
| 50 |
-
|
| 51 |
-
// author box name
|
| 52 |
-
echo '<div class="saboxplugin-authorname">';
|
| 53 |
-
echo apply_filters( 'sabox_author_html', $sab_author_link, $sabox_options, $sabox_author_id );
|
| 54 |
-
if ( is_user_logged_in() && get_current_user_id() == $sabox_author_id ) {
|
| 55 |
-
echo '<a class="sab-profile-edit" target="_blank" href="' . get_edit_user_link() . '"> ' . esc_html__( 'Edit profile', 'saboxplugin' ) . '</a>';
|
| 56 |
-
}
|
| 57 |
-
echo '</div>';
|
| 58 |
-
|
| 59 |
-
// author box description
|
| 60 |
-
echo '<div class="saboxplugin-desc">';
|
| 61 |
-
echo '<div itemprop="description">';
|
| 62 |
-
|
| 63 |
-
$author_description = wptexturize( $author_description );
|
| 64 |
-
$author_description = wpautop( $author_description );
|
| 65 |
-
echo wp_kses_post( $author_description );
|
| 66 |
-
if ( '' == $author_description && is_user_logged_in() && $sabox_author_id == get_current_user_id() ) {
|
| 67 |
-
echo '<a target="_blank" href="' . admin_url() . 'profile.php?#wp-description-wrap">' . esc_html__( 'Add Biographical Info', 'saboxplugin' ) . '</a>';
|
| 68 |
-
}
|
| 69 |
-
echo '</div>';
|
| 70 |
-
echo '</div>';
|
| 71 |
-
|
| 72 |
-
if ( is_single() || is_page() ) {
|
| 73 |
-
if ( get_the_author_meta( 'user_url' ) != '' && '1' == $sabox_options['sab_web'] ) { // author website on single
|
| 74 |
-
echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
|
| 75 |
-
echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . $sab_web_rel . '>' . esc_html( Simple_Author_Box_Helper::strip_prot(get_the_author_meta( 'user_url', $sabox_author_id )) ) . '</a>';
|
| 76 |
-
echo '</div>';
|
| 77 |
-
}
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
if ( is_author() || is_archive() ) {
|
| 82 |
-
if ( get_the_author_meta( 'user_url' ) != '' ) { // force show author website on author.php or archive.php
|
| 83 |
-
echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">';
|
| 84 |
-
echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . $sab_web_rel . '>' . esc_html( Simple_Author_Box_Helper::strip_prot(get_the_author_meta( 'user_url', $sabox_author_id )) ) . '</a>';
|
| 85 |
-
echo '</div>';
|
| 86 |
-
}
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
// author box clearfix
|
| 90 |
-
echo '<div class="clearfix"></div>';
|
| 91 |
-
|
| 92 |
-
// author box social icons
|
| 93 |
-
$author = get_userdata( $sabox_author_id );
|
| 94 |
-
$show_social_icons = apply_filters( 'sabox_hide_social_icons', true, $author );
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
|
| 98 |
-
echo '<div class="sab-edit-settings">';
|
| 99 |
-
echo '<a target="_blank" href="' . admin_url() . 'admin.php?page=simple-author-box-options">' . esc_html__( 'Settings', 'saboxplugin' ) . '<i class="dashicons dashicons-admin-settings"></i></a>';
|
| 100 |
-
echo '</div>';
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
$show_email = isset($sabox_options['sab_email'] ) && '0' == $sabox_options['sab_email'] ? false : true;
|
| 104 |
-
$social_links = Simple_Author_Box_Helper::get_user_social_links( $sabox_author_id, $show_email );
|
| 105 |
-
|
| 106 |
-
if ( empty( $social_links ) && is_user_logged_in() && $sabox_author_id == get_current_user_id() ) {
|
| 107 |
-
echo '<a target="_blank" href="' . admin_url() . 'profile.php?#sabox-social-table">' . esc_html__( 'Add Social Links', 'saboxplugin' ) . '</a>';
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
if ( isset($sabox_options['sab_hide_socials']) && '0' == $sabox_options['sab_hide_socials'] && $show_social_icons && ! empty( $social_links ) ) { // hide social icons div option
|
| 111 |
-
echo '<div class="saboxplugin-socials ' . esc_attr( $sabox_color ) . '">';
|
| 112 |
-
|
| 113 |
-
foreach ( $social_links as $social_platform => $social_link ) {
|
| 114 |
-
|
| 115 |
-
if ( 'user_email' == $social_platform ) {
|
| 116 |
-
$social_link = 'mailto:' . antispambot( $social_link );
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
if ( 'whatsapp' == $social_platform ) {
|
| 120 |
-
$social_link = 'https://wa.me/' . $social_link;
|
| 121 |
-
}
|
| 122 |
-
|
| 123 |
-
if ( 'phone' == $social_platform ) {
|
| 124 |
-
$social_link = 'tel:' . $social_link;
|
| 125 |
-
}
|
| 126 |
-
|
| 127 |
-
if ( 'telegram' == $social_platform ) {
|
| 128 |
-
$social_link = 'https://t.me/' . $social_link;
|
| 129 |
-
}
|
| 130 |
-
|
| 131 |
-
if ( 'skype' == $social_platform ) {
|
| 132 |
-
$social_link = 'skype:' . $social_link.'?call';
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
if ( ! empty( $social_link ) ) {
|
| 136 |
-
echo Simple_Author_Box_Helper::get_sabox_social_icon( $social_link, $social_platform );
|
| 137 |
-
}
|
| 138 |
-
}
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
echo '</div>';
|
| 142 |
-
} // end of social icons
|
| 143 |
-
echo '</div>'; // end of saboxplugin-wrap div
|
| 144 |
-
}
|
| 145 |
}
|
| 146 |
-
|
| 1 |
<?php
|
| 2 |
+
|
| 3 |
+
if ( isset( $sabox_options['sab_colored'] ) && '1' == $sabox_options['sab_colored'] ) {
|
| 4 |
+
$sabox_color = 'sabox-colored';
|
| 5 |
} else {
|
| 6 |
+
$sabox_color = '';
|
| 7 |
}
|
| 8 |
|
| 9 |
+
|
| 10 |
+
if ( isset( $sabox_options['sab_web_position'] ) && '0' != $sabox_options['sab_web_position'] ) {
|
| 11 |
+
$sab_web_align = 'sab-web-position';
|
| 12 |
} else {
|
| 13 |
+
$sab_web_align = '';
|
| 14 |
}
|
| 15 |
|
| 16 |
+
|
| 17 |
+
if ( isset( $sabox_options['sab_web_target'] ) && '1' == $sabox_options['sab_web_target'] ) {
|
| 18 |
+
$sab_web_target = '_blank';
|
| 19 |
} else {
|
| 20 |
+
$sab_web_target = '_self';
|
| 21 |
}
|
| 22 |
|
| 23 |
+
|
| 24 |
+
if ( isset( $sabox_options['sab_web_rel'] ) && '1' == $sabox_options['sab_web_rel'] ) {
|
| 25 |
+
$sab_web_rel = 'rel="nofollow"';
|
| 26 |
} else {
|
| 27 |
+
$sab_web_rel = '';
|
| 28 |
}
|
| 29 |
|
| 30 |
$sab_author_link = sprintf( '<a href="%s" class="vcard author" rel="author" itemprop="url"><span class="fn" itemprop="name">%s</span></a>', esc_url( get_author_posts_url( $sabox_author_id ) ), esc_html( get_the_author_meta( 'display_name', $sabox_author_id ) ) );
|
| 31 |
+
$author_description = apply_filters( 'sab_user_description', get_the_author_meta( 'description', $sabox_author_id ), $sabox_author_id );
|
| 32 |
+
|
| 33 |
+
if ( '' != $author_description || isset( $sabox_options['sab_no_description'] ) && '0' == $sabox_options['sab_no_description'] ) {
|
| 34 |
+
// hide the author box if no description is provided
|
| 35 |
+
$show_guest_only = ( get_post_meta( get_the_ID(), '_disable_sab_author_here', true ) ? get_post_meta( get_the_ID(), '_disable_sab_author_here', true ) : "false" );
|
| 36 |
+
|
| 37 |
+
if ( $show_guest_only != "on" ) {
|
| 38 |
+
echo '<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">' ;
|
| 39 |
+
// start saboxplugin-wrap div
|
| 40 |
+
// author box gravatar
|
| 41 |
+
echo '<div class="saboxplugin-gravatar">' ;
|
| 42 |
+
$custom_profile_image = get_the_author_meta( 'sabox-profile-image', $sabox_author_id );
|
| 43 |
+
|
| 44 |
+
if ( '' != $custom_profile_image ) {
|
| 45 |
+
$mediaid = attachment_url_to_postid( $custom_profile_image );
|
| 46 |
+
$alt = ( $mediaid ? get_post_meta( $mediaid, '_wp_attachment_image_alt', true ) : '' );
|
| 47 |
+
$link = null;
|
| 48 |
+
$nofollow = '';
|
| 49 |
+
$link = get_author_posts_url( $sabox_author_id );
|
| 50 |
+
if ( $link != null ) {
|
| 51 |
+
echo "<a {$nofollow} href='" . $link . "'>" ;
|
| 52 |
+
}
|
| 53 |
+
echo '<img src="' . esc_url( $custom_profile_image ) . '" alt="' . esc_attr( $alt ) . '" itemprop="image">' ;
|
| 54 |
+
if ( $link != null ) {
|
| 55 |
+
echo "</a>" ;
|
| 56 |
+
}
|
| 57 |
+
} else {
|
| 58 |
+
echo get_avatar(
|
| 59 |
+
get_the_author_meta( 'user_email', $sabox_author_id ),
|
| 60 |
+
'100',
|
| 61 |
+
'',
|
| 62 |
+
'',
|
| 63 |
+
array(
|
| 64 |
+
'extra_attr' => 'itemprop="image"',
|
| 65 |
+
)
|
| 66 |
+
) ;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
echo '</div>' ;
|
| 70 |
+
// author box name
|
| 71 |
+
echo '<div class="saboxplugin-authorname">' ;
|
| 72 |
+
echo apply_filters(
|
| 73 |
+
'sabox_author_html',
|
| 74 |
+
$sab_author_link,
|
| 75 |
+
$sabox_options,
|
| 76 |
+
$sabox_author_id
|
| 77 |
+
) ;
|
| 78 |
+
if ( is_user_logged_in() && get_current_user_id() == $sabox_author_id ) {
|
| 79 |
+
echo '<a class="sab-profile-edit" target="_blank" href="' . get_edit_user_link() . '"> ' . esc_html__( 'Edit profile', 'saboxplugin' ) . '</a>' ;
|
| 80 |
+
}
|
| 81 |
+
echo '</div>' ;
|
| 82 |
+
// author box description
|
| 83 |
+
echo '<div class="saboxplugin-desc">' ;
|
| 84 |
+
echo '<div itemprop="description">' ;
|
| 85 |
+
$author_description = wptexturize( $author_description );
|
| 86 |
+
$author_description = wpautop( $author_description );
|
| 87 |
+
echo wp_kses_post( $author_description ) ;
|
| 88 |
+
if ( '' == $author_description && is_user_logged_in() && $sabox_author_id == get_current_user_id() ) {
|
| 89 |
+
echo '<a target="_blank" href="' . admin_url() . 'profile.php?#wp-description-wrap">' . esc_html__( 'Add Biographical Info', 'saboxplugin' ) . '</a>' ;
|
| 90 |
+
}
|
| 91 |
+
echo '</div>' ;
|
| 92 |
+
echo '</div>' ;
|
| 93 |
+
if ( is_single() || is_page() ) {
|
| 94 |
+
|
| 95 |
+
if ( get_the_author_meta( 'user_url' ) != '' && '1' == $sabox_options['sab_web'] ) {
|
| 96 |
+
// author website on single
|
| 97 |
+
echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">' ;
|
| 98 |
+
echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . $sab_web_rel . '>' . esc_html( Simple_Author_Box_Helper::strip_prot( get_the_author_meta( 'user_url', $sabox_author_id ) ) ) . '</a>' ;
|
| 99 |
+
echo '</div>' ;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
}
|
| 103 |
+
if ( is_author() || is_archive() ) {
|
| 104 |
+
|
| 105 |
+
if ( get_the_author_meta( 'user_url' ) != '' ) {
|
| 106 |
+
// force show author website on author.php or archive.php
|
| 107 |
+
echo '<div class="saboxplugin-web ' . esc_attr( $sab_web_align ) . '">' ;
|
| 108 |
+
echo '<a href="' . esc_url( get_the_author_meta( 'user_url', $sabox_author_id ) ) . '" target="' . esc_attr( $sab_web_target ) . '" ' . $sab_web_rel . '>' . esc_html( Simple_Author_Box_Helper::strip_prot( get_the_author_meta( 'user_url', $sabox_author_id ) ) ) . '</a>' ;
|
| 109 |
+
echo '</div>' ;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
}
|
| 113 |
+
// author box clearfix
|
| 114 |
+
echo '<div class="clearfix"></div>' ;
|
| 115 |
+
// author box social icons
|
| 116 |
+
$author = get_userdata( $sabox_author_id );
|
| 117 |
+
$show_social_icons = apply_filters( 'sabox_hide_social_icons', true, $author );
|
| 118 |
+
|
| 119 |
+
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
|
| 120 |
+
echo '<div class="sab-edit-settings">' ;
|
| 121 |
+
echo '<a target="_blank" href="' . admin_url() . 'admin.php?page=simple-author-box-options">' . esc_html__( 'Settings', 'saboxplugin' ) . '<i class="dashicons dashicons-admin-settings"></i></a>' ;
|
| 122 |
+
echo '</div>' ;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
$show_email = ( isset( $sabox_options['sab_email'] ) && '0' == $sabox_options['sab_email'] ? false : true );
|
| 126 |
+
$social_links = Simple_Author_Box_Helper::get_user_social_links( $sabox_author_id, $show_email );
|
| 127 |
+
if ( empty($social_links) && is_user_logged_in() && $sabox_author_id == get_current_user_id() ) {
|
| 128 |
+
echo '<a target="_blank" href="' . admin_url() . 'profile.php?#sabox-social-table">' . esc_html__( 'Add Social Links', 'saboxplugin' ) . '</a>' ;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
if ( isset( $sabox_options['sab_hide_socials'] ) && '0' == $sabox_options['sab_hide_socials'] && $show_social_icons && !empty($social_links) ) {
|
| 132 |
+
// hide social icons div option
|
| 133 |
+
echo '<div class="saboxplugin-socials ' . esc_attr( $sabox_color ) . '">' ;
|
| 134 |
+
foreach ( $social_links as $social_platform => $social_link ) {
|
| 135 |
+
if ( 'user_email' == $social_platform ) {
|
| 136 |
+
$social_link = 'mailto:' . antispambot( $social_link );
|
| 137 |
+
}
|
| 138 |
+
if ( 'whatsapp' == $social_platform ) {
|
| 139 |
+
$social_link = 'https://wa.me/' . $social_link;
|
| 140 |
+
}
|
| 141 |
+
if ( 'phone' == $social_platform ) {
|
| 142 |
+
$social_link = 'tel:' . $social_link;
|
| 143 |
+
}
|
| 144 |
+
if ( 'telegram' == $social_platform ) {
|
| 145 |
+
$social_link = 'https://t.me/' . $social_link;
|
| 146 |
+
}
|
| 147 |
+
if ( 'skype' == $social_platform ) {
|
| 148 |
+
$social_link = 'skype:' . $social_link . '?call';
|
| 149 |
+
}
|
| 150 |
+
if ( !empty($social_link) ) {
|
| 151 |
+
echo Simple_Author_Box_Helper::get_sabox_social_icon( $social_link, $social_platform ) ;
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
echo '</div>' ;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
// end of social icons
|
| 158 |
+
echo '</div>' ;
|
| 159 |
+
// end of saboxplugin-wrap div
|
| 160 |
+
}
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
}
|
|
|
