绿站
绿色文摘
今天是:

交流 | 搜索 | +发贴

wordpress后台只显示自己发布的文章
nydalu 2024年7月6日 136次

WordPress后台新增用户后,用户登录后只能看到自己发布的文章和内容,不能看到其它人发布的内容,那么改怎么操作呢?

用户→所有用户→新增用户

/** 只显示自己发布的文章 **/
function mypo_parse_query_useronly( $wp_query ) {
if ( strpos( $_SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/edit.php’ ) !== false ) {
if ( !current_user_can( ‘level_10’ ) ) {
global $current_user;
$wp_query->set( ‘author’, $current_user->id );
}
}
}
add_filter(‘parse_query’, ‘mypo_parse_query_useronly’ );


  • pqf64cd8e32f5ac7553c150bd05d6f2252bb73f68dpq 24-11-12 22:15  

    pq118a9989815489c24b81b160782015890ed2085epq


  • xvawmlajgp 24-11-19 01:07  

    Muchas gracias. ?Como puedo iniciar sesion?


  • drover sointeru 24-12-28 16:33  

    It?¦s really a great and useful piece of info. I?¦m satisfied that you shared this helpful info with us. Please stay us informed like this. Thank you for sharing.

    https://www.droversointeru.com


  • HD WTA Tour live streaming 25-04-07 05:55  

    It’s a pity you don’t have a donate button! I’d definitely donate to this brilliant blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates and will share this site with my Facebook group. Chat soon!

    https://tennisonline.me/wta-tour-online-stream


  • droversointeru 25-04-10 14:33  

    It’s really a cool and useful piece of information. I am glad that you shared this useful information with us. Please keep us informed like this. Thanks for sharing.

    https://www.droversointeru.com



  • 关于 ·登录·管理
    加载0.849 查询 16