开发者

Show comments only to author and admins

开发者 https://www.devze.com 2023-03-18 14:17 出处:网络
Is it possible to restrict a user so that they only see their own comments along with any admin user replies and for the admin开发者_C百科 user to see all users comments?

Is it possible to restrict a user so that they only see their own comments along with any admin user replies and for the admin开发者_C百科 user to see all users comments?

The user should also be able to edit their own comments.

I am trying to use sessions to do that.......but unable to achieve how can do using session by retrieving user_id of particular current user in wordpress?


In wordpress you can get current users data with function wp_get_current_user(); check http://codex.wordpress.org/Function_Reference/wp_get_current_user .

To restict user to view only his/her comments, you have to alter wordpress's theme's comments.php file.

0

精彩评论

暂无评论...
验证码 换一张
取 消