禁止游客查看文章的一个插件,需要自己制作,本站仅提供源码。
无
插件信息
将下面这段代码保存到一个名为 hide-posts-from-guests.php 的文件中,并放在WordPress站点的插件目录。然后,在WordPress后台激活插件即可。
下载地址
<?php
/* Plugin Name: Hide Posts from Guests
Description: This plugin hides post content from guests.
Version: 1.0
Author: OpenAI
*/
add_filter( 'the_content', 'hide_posts_from_guests' );
function hide_posts_from_guests( $content ) { if ( !is_user_logged_in() ) {
return '抱歉,您必须登录才能查看内容。' ;
} return $content; }
© 版权声明
下载问题:
1.下载地址为什么隐藏了? 答:为了防止爬虫非法采集,以及链接被和谐。登录后即可免费下载!
2.无法找到所需书籍或软件或者链接已失效? 答:可以直接给站长留言(24小时内处理)。
2.无法找到所需书籍或软件或者链接已失效? 答:可以直接给站长留言(24小时内处理)。
THE END
暂无评论内容