i had been looking for the code where logged in users will be able to see post of his own only i have managed to make simple function that we can use for the same the function snippet has to be included in functions .php file in the theme folder which you are using
function my_plugin_get_comment_list_by_user($clauses)
{
if (is_admin())
{
global $user_ID, $wpdb;
$clauses['join'] = ", wp_posts";
$clauses['where'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
};
return $clauses;
}
// Ensure that editors and admins can moderate all comments
if(!current_user_can('edit_others_posts'))
{
add_filter('comments_clauses', 'my_plugin_get_comment_list_by_user');
}
Thanks
NIkhil Joshi
Related Posts:
- Can an admin check passwords of registered users?
- You do not have permission to access this document on form submit
- How to obtain the user ID of the current profile being edited in WP-Admin?
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- In administration, how do I display comments of a certain user?
- How can I make the user names of commentors clickable links to the user’s profile from the admin comment screen?
- Redirect admin 403 “Cheatin uh?” admin pages
- Capability to read/edit page in wp-admin only for administrators
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- What are the standard admin CSS id/class tags?
- Modal window from within WordPress admin
- Admin Page Redirect
- How to Change the Default Home Page for the WordPress Dashboard?
- Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
- Find out which moderator approved comment?
- How To Remove WordPress Version From The Admin Footer
- Set Default Admin Colour For All Users
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Securing Admin Accounts – Username Discovery
- How-to make the admin area mobile friendly [closed]
- 3.3: How do you hide the new dashboard welcome panel?
- Make A WordPress Page Accessible To Admins Only, Redirect Other User Roles
- How to add filter in “Comments” at the admin panel?
- Appearance->Editor not visible
- Hide update messages from non-admin users?
- Possible to create placeholder images in WordPress editor that are clickable (should bring up uploader)?
- Add extra field when admin create user
- Admin pages have no content
- Add a custom column in users list page
- Blocking Administrative Access to Authors and Subcribers?
- Customize Admin Users Screen based on Role
- Make certain pages uneditable by editors?
- wp-admin: Sort users by surname
- Add User meta fields, which only admin can edit
- How to find out if an wp-admin action edited a file?
- WordPress 3.8 get current admin color scheme
- How to Use Resposive Tables in WordPress ADMIN Pages?
- What filter/action hook can I use to add a few links to the admin comments page?
- Add Admin User via SQL
- Can you have the users list pre sorted by specific column?
- How can I access profile Admin Colour Scheme
- How to remove Gravatar from Username column
- I keep getting logged out in Firefox
- Add tabbed menu to admin page
- remove_action with profile_personal_options
- Getting the different post statuses + count like in edit.php, in a custom submenu page
- How do I enable new account notification emails (to the administrator)?
- how to redirect to url.com/wp-admin if url.com/admin is typed in?
- Restrict dashboard access for specific user roles to specific actions
- How To Create User Specific Admin User Pages?
- Change the Default Pages Menu View in wp-admin
- New users must comment when requesting username
- Add a wordpress blog to my website having users
- user-new.php less detailed after WP3.1; how to revert?
- Protect custom php file with login
- $user_id vs. is_user_logged_in()
- Conditionally load CSS/JS/PHP in wp-admin if using a mobile device
- How to disable automatic excerpt generation *in admin*?
- Get current logged in user under 3.1, re: remove “Howdy”
- Limit Words in Category / Term Description – Admin Panel
- Change top level menu item to point to custom submenu item
- List User order by ID in Descending order (Backend)
- Associating custom submenu item with post type of top level menu item
- Manage users custom column add class “num”
- Adding text in more than one language (at the same time)
- wp-admin post.php JavaScript Links Not Working
- front end editing using iFrames, best approach?
- Super slow admin panel
- Admin Taxonomy Terms – Orderby Term Field
- How do I add an admin notice within javascript in the admin interface for posts?
- Fatal error: Exception thrown without a stack frame in Unknown on line 0
- Hide Pages on Edit Pages based on Capability (edit_others_pages)?
- Hide one admin from another admin
- Newly created user role not displaying on users screen
- How To Remove Import/Export Option From Tools?
- Doesn’t call user information to include “wp-load.php” in an external php file
- restrict admin panel sections to users
- Redirect non-admin after login, and in url – /admin
- Hide top admin panel for non admin and non editors
- When admin approves a registered user, I don’t want to send a notification email to users
- Is it possible to create a custom admin page for users?
- Localhost install: Administrator lost administrator access; cannot access Dashboard
- Custom redirection when managing users in admin
- Signed-in as admin on just part of the site
- Let user delete comment on front end only
- Different role for free and pro users in wordpress without using bbpress
- How to update my website with WordPress?
- wordpress login loop after install
- Unable to render Admin Notices
- WordPress login not working
- Admin blank but Admin menu showing
- Problems in migration of WordPress site from local server to the online server
- How to create functions that affect only a specific user
- WYSIWYG editor not in a post editor?
- htaccess and htpasswd
- plugin to upload to youtube via wordpress [closed]
- One folder to be accessible by one user
- Add a user to edit the layout of a site
- Administrator user cannot access dashboard after localwp import
- WordPress change role from administrator to author by itself (automatically)