当前位置: 首页> 财经> 产业 > 淮南寿县_男科治疗价目表_网页搜索_优化搜索引擎营销

淮南寿县_男科治疗价目表_网页搜索_优化搜索引擎营销

时间:2025/8/29 11:39:27来源:https://blog.csdn.net/nanchengzs/article/details/142928334 浏览次数:0次
淮南寿县_男科治疗价目表_网页搜索_优化搜索引擎营销

前言

子比主题用户中心的文章、评论、粉丝等默认全部人可见,但是有时不想让全部人可见就可以开启此功能

图片展示

教程开始

把以下代码添加到子比主题下,按顺序找到该文件/inc/functions/zib-author.php,在zib-author.php第374行把原代码删除掉粘贴下面代码。

//作者页面-评论tab
function zib_main_author_tab_content_comment()
{global $wp_query;$curauth = $wp_query->get_queried_object();if (empty($curauth->ID)) {return;}$author_id = $curauth->ID;$current_user = wp_get_current_user();$page = zib_get_the_paged();if (isset($_POST['comment_visibility'])) {$new_visibility = sanitize_text_field($_POST['comment_visibility']);update_user_meta($author_id, 'comment_visibility', $new_visibility);$comment_visibility = $new_visibility;} else {$comment_visibility = get_user_meta($author_id, 'comment_visibility', true);if (!$comment_visibility) {$comment_visibility = 'all';}}$header = '';$this_url = zib_get_current_url();if (1 == $page || !_pz('paging_ajax_s', true)) {$this_url = zib_url_del_paged($this_url);$visibility_html = '';if ($current_user->ID == $author_id) {$visibility_options = array('all' => '全部人可见','self' => '仅自己可见',);$visibility_dropdown_but = '';foreach ($visibility_options as $value => $label) {$active_class = ($comment_visibility == $value) ? ' class="active"' : '';$visibility_dropdown_but .= '<li' . $active_class . '><a href="javascript:;" onclick="document.getElementById(\'comment_visibility_form\').comment_visibility.value=\'' . $value . '\'; document.getElementById(\'comment_visibility_form\').submit();">' . $label . '</a></li>';}$current_visibility_label = $visibility_options[$comment_visibility];$visibility_html = '<form method="post" id="comment_visibility_form" class="comment-visibility-form">';$visibility_html .= '<input type="hidden" name="comment_visibility" value="' . $comment_visibility . '">';$visibility_html .= '<div class="dropdown flex0 pull-right">';$visibility_html .= '<a href="javascript:;" class="but" data-toggle="dropdown">可见性: ' . $current_visibility_label . '<i class="ml6 fa fa-caret-down opacity5" aria-hidden="true" style="margin-right:0;"></i></a>';$visibility_html .= '<ul class="dropdown-menu">' . $visibility_dropdown_but . '</ul>';$visibility_html .= '</div>';$visibility_html .= '</form>';}$header = '<div class="ajax-item flex ac jsb mb10 px12-sm"><div class="scroll-x mini-scrollbar mr10"></div>' . $visibility_html . '</div>';}if ($comment_visibility == 'self' && $current_user->ID != $author_id) {$message = zib_get_ajax_null('仅自己可见', '0', 'null-post.svg');return $header . $message;}$comments_content = zib_get_author_comment($author_id);return $header . $comments_content;
}

这里我只改了评论和粉丝页面的隐私,可以根据自己改别的页面

关键字:淮南寿县_男科治疗价目表_网页搜索_优化搜索引擎营销

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: