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’ );
Muchas gracias. ?Como puedo iniciar sesion?
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
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
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
pq118a9989815489c24b81b160782015890ed2085epq