Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../componen.../author-b...
File: author-box.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
function ampforwp_framework_get_author_box( $args=array() ) {
[4] Fix | Delete
// Simple Author Box compatibility #2268
[5] Fix | Delete
if( class_exists('Simple_Author_Box') && !isset($args['author_info']) ){
[6] Fix | Delete
return;
[7] Fix | Delete
}
[8] Fix | Delete
global $post, $redux_builder_amp;
[9] Fix | Delete
$post_author = is_object($post) ? get_userdata($post->post_author):'';
[10] Fix | Delete
if(empty($post_author)){
[11] Fix | Delete
return;
[12] Fix | Delete
}
[13] Fix | Delete
if ( ! is_array($args) ) {
[14] Fix | Delete
$args = array();
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
$avatar = false; //To show author Avater
[18] Fix | Delete
$author_pub_name = false; //To show author name
[19] Fix | Delete
$avatar_size = 40;
[20] Fix | Delete
$author_description = false;
[21] Fix | Delete
$class = $author_prefix = $author_wrapper_class = '';
[22] Fix | Delete
$show_date = false;
[23] Fix | Delete
$show_time = false;
[24] Fix | Delete
$author_name = $post_author->display_name;
[25] Fix | Delete
$author_name = apply_filters('ampforwp_modify_author_name',$author_name);
[26] Fix | Delete
$and_text = '';
[27] Fix | Delete
$avatar_size_weight = $avatar_size_height = '';
[28] Fix | Delete
$and_text = ampforwp_translation($redux_builder_amp['amp-translator-and-text'], 'and' );
[29] Fix | Delete
if ( function_exists('coauthors') ) {
[30] Fix | Delete
$author_name = coauthors($and_text,$and_text,null,null,false);
[31] Fix | Delete
}
[32] Fix | Delete
$author_link = get_author_posts_url($post_author->ID);
[33] Fix | Delete
if ( function_exists('coauthors_posts_links') ) {
[34] Fix | Delete
$author_link = coauthors_posts_links($and_text,$and_text,null,null,false);
[35] Fix | Delete
}
[36] Fix | Delete
$author_image_wrapper = $alt = '';
[37] Fix | Delete
[38] Fix | Delete
if ( isset($args['author_pub_name']) ) {
[39] Fix | Delete
$author_pub_name = $args['author_pub_name'];
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
if ( isset($args['avatar']) ) {
[43] Fix | Delete
$avatar = $args['avatar'];
[44] Fix | Delete
}
[45] Fix | Delete
if ( isset($args['avatar_size']) ) {
[46] Fix | Delete
$avatar_size = ampforwp_get_setting('amp-author-bio-image-width');
[47] Fix | Delete
$avatar_size_width = ampforwp_get_setting('amp-author-bio-image-width');
[48] Fix | Delete
$avatar_size_height = ampforwp_get_setting('amp-author-bio-image-height');
[49] Fix | Delete
if (empty($avatar_size_width)) {
[50] Fix | Delete
$avatar_size_width = 60;
[51] Fix | Delete
}
[52] Fix | Delete
if (empty($avatar_size_height)) {
[53] Fix | Delete
$avatar_size_height = 60;
[54] Fix | Delete
}
[55] Fix | Delete
if (empty($avatar_size)) {
[56] Fix | Delete
$avatar_size_width = 60;
[57] Fix | Delete
}
[58] Fix | Delete
}
[59] Fix | Delete
if ( isset($args['class']) ) {
[60] Fix | Delete
$class = $args['class'];
[61] Fix | Delete
}
[62] Fix | Delete
if ( isset($args['author_description']) ) {
[63] Fix | Delete
$author_description = $args['author_description'];
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
[67] Fix | Delete
if ( isset( $args['author_prefix']) ) {
[68] Fix | Delete
$author_prefix = $args['author_prefix'];
[69] Fix | Delete
}
[70] Fix | Delete
//$author_prefix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
[71] Fix | Delete
[72] Fix | Delete
if ( isset( $args['author_link']) ) {
[73] Fix | Delete
$author_link = $args['author_link'];
[74] Fix | Delete
}
[75] Fix | Delete
$is_author_link_amp = true;
[76] Fix | Delete
if ( isset( $args['is_author_link_amp']) ) {
[77] Fix | Delete
$is_author_link_amp = $args['is_author_link_amp'];
[78] Fix | Delete
}
[79] Fix | Delete
if ( isset( $args['author_wrapper_class']) ) {
[80] Fix | Delete
$author_wrapper_class = $args['author_wrapper_class'];
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
if ( isset($args['author_image_wrapper']) ) {
[84] Fix | Delete
$author_image_wrapper = $args['author_image_wrapper'];
[85] Fix | Delete
}
[86] Fix | Delete
if ( isset($args['show_date']) ) {
[87] Fix | Delete
$show_date = $args['show_date'];
[88] Fix | Delete
}
[89] Fix | Delete
if ( isset($args['show_time']) ) {
[90] Fix | Delete
$show_time = $args['show_time'];
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
?>
[94] Fix | Delete
<div class="amp-author <?php echo esc_attr($class); ?>">
[95] Fix | Delete
<?php if ( $avatar && true == ampforwp_get_setting('amp-author-bio-image')) {
[96] Fix | Delete
$author_avatar_url = ampforwp_get_wp_user_avatar();
[97] Fix | Delete
if( null == $author_avatar_url ){
[98] Fix | Delete
$author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
[99] Fix | Delete
}
[100] Fix | Delete
if(class_exists('WP_User_Avatar_Functions') && defined('PPRESS_VERSION_NUMBER') && version_compare(PPRESS_VERSION_NUMBER,'3.0', '<')){
[101] Fix | Delete
$image = get_wp_user_avatar();
[102] Fix | Delete
if (!empty($image)) {
[103] Fix | Delete
preg_match_all( '@alt="([^"]+)"@' , $image, $match );
[104] Fix | Delete
$alt = array_pop($match);
[105] Fix | Delete
$alt = implode(" ", $alt);
[106] Fix | Delete
$alt = explode(" ", $alt);
[107] Fix | Delete
if(class_exists('transposh_plugin') && isset($_GET['lang']) && isset($alt[1]) ){
[108] Fix | Delete
$alt = 'alt=' . $alt[1];
[109] Fix | Delete
}
[110] Fix | Delete
elseif (isset($alt[0])) {
[111] Fix | Delete
$alt = 'alt=' . $alt[0];
[112] Fix | Delete
}
[113] Fix | Delete
}
[114] Fix | Delete
}
[115] Fix | Delete
?>
[116] Fix | Delete
<div class="amp-author-image <?php echo esc_attr($author_image_wrapper); ?>">
[117] Fix | Delete
<amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?>src="<?php echo esc_url($author_avatar_url); ?>" <?php echo esc_attr($alt); ?> width="<?php echo esc_attr($avatar_size_width); ?>" height="<?php echo esc_attr($avatar_size_height); ?>" layout="fixed"></amp-img>
[118] Fix | Delete
</div>
[119] Fix | Delete
<?php } ?>
[120] Fix | Delete
<?php echo '<div class="author-details '. esc_attr($author_wrapper_class) .'">';
[121] Fix | Delete
if ( true == ampforwp_get_setting('ampforwp-author-page-url') ){
[122] Fix | Delete
if ( function_exists('coauthors_posts_links') ) {
[123] Fix | Delete
if( $author_pub_name ){
[124] Fix | Delete
$author_link_ = $author_link;
[125] Fix | Delete
if($is_author_link_amp==true && ampforwp_get_setting('ampforwp-archive-support')){
[126] Fix | Delete
$author_link_ = ampforwp_url_controller($author_link);
[127] Fix | Delete
if($author_link_)
[128] Fix | Delete
{
[129] Fix | Delete
echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url($author_link_).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
[130] Fix | Delete
}
[131] Fix | Delete
else
[132] Fix | Delete
{
[133] Fix | Delete
echo $author_link; // this is html
[134] Fix | Delete
}
[135] Fix | Delete
}
[136] Fix | Delete
echo ampforwp_yoast_twitter_handle();
[137] Fix | Delete
}
[138] Fix | Delete
}
[139] Fix | Delete
else {
[140] Fix | Delete
if( $author_pub_name ){
[141] Fix | Delete
if($is_author_link_amp==true && ampforwp_get_setting('ampforwp-archive-support')){
[142] Fix | Delete
$author_link = ampforwp_url_controller($author_link);
[143] Fix | Delete
}
[144] Fix | Delete
echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url($author_link).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
[145] Fix | Delete
echo ampforwp_yoast_twitter_handle();
[146] Fix | Delete
}
[147] Fix | Delete
}
[148] Fix | Delete
}
[149] Fix | Delete
else{
[150] Fix | Delete
if( $author_pub_name ){
[151] Fix | Delete
echo '<span class="author-name">' . esc_html($author_prefix) . esc_html( $author_name ) . '</span>';
[152] Fix | Delete
echo ampforwp_yoast_twitter_handle();
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
//to show date and time
[157] Fix | Delete
if ( $show_date || $show_time ) {
[158] Fix | Delete
echo '<span class="posted-time"> ';
[159] Fix | Delete
if ( $show_date ) {
[160] Fix | Delete
echo esc_html( get_the_date() ) . ' ';
[161] Fix | Delete
}
[162] Fix | Delete
if ( $show_time ) {
[163] Fix | Delete
echo esc_html( get_the_time());
[164] Fix | Delete
}
[165] Fix | Delete
echo '</span>';
[166] Fix | Delete
}
[167] Fix | Delete
if ( $author_description ) {
[168] Fix | Delete
if( true == ampforwp_get_setting('amp-author-box-description') ){
[169] Fix | Delete
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
[170] Fix | Delete
$author_description = "<p>".strip_tags($post_author->description,$allowed_tags)."</p>";
[171] Fix | Delete
$author_description = apply_filters( 'ampforwp_author_description', $author_description);
[172] Fix | Delete
echo $author_description;
[173] Fix | Delete
}
[174] Fix | Delete
} ?>
[175] Fix | Delete
</div>
[176] Fix | Delete
</div>
[177] Fix | Delete
<?php
[178] Fix | Delete
if(is_singular() && ( isset($args['ads_below_the_author']) && true == $args['ads_below_the_author'] )){
[179] Fix | Delete
do_action('ampforwp_below_author_box');
[180] Fix | Delete
}
[181] Fix | Delete
}
[182] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function