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?
- Modal window from within WordPress admin
- How to Change the Default Home Page for the WordPress Dashboard?
- Find out which moderator approved comment?
- 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
- Appearance->Editor not visible
- 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
- 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?
- How to Use Resposive Tables in WordPress ADMIN Pages?
- How can I access profile Admin Colour Scheme
- 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?
- How to disable automatic excerpt generation *in admin*?
- Get current logged in user under 3.1, re: remove “Howdy”
- 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”
- front end editing using iFrames, best approach?
- Hide Pages on Edit Pages based on Capability (edit_others_pages)?
- Hide one admin from another admin
- Displaying different in-page content to cliente/admin
- How to hide a specific part of dashboard for non-admin roles?
- Add ‘Last Modified’ and Attachments (Yes/No) to WordPress Users Column
- Editors change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?
- How Can I Found Admin Directory
- WordPress post feature image not uploading
- Combine and Minify wp-admin files, also re-write URI’s for CDN
- WordPress administrator area access disabled temporarily due to widespread brute force attacks
- 500 internal server error on wp-admin only
- Redirect from the dashboard to edit.php if wp_is_mobile() is true
- Keep Logged in Users out of Admin Panel
- Seems that admin_post_{action} does not executing
- Add Custom Script in Other Plugin’s Options page
- When submitting the form site.com/blog/wp-admin it goes to site.com/wp-admin
- Create a WordPress administrator without access to back-end
- Can I host WP-admin locally for a remote blog?
- Shared account / dual blogging in WordPress
- WordPress Brute Force Prevention
- Customizing Users in Admin Area
- Admin login not working
- Adding and removing columns from the admin pages panel
- I’m a super admin and I want to give an admin the ability to add new users…?
- Is there a plugin for WordPress for creating ‘Accounts’ where all users who belong to that Account can only see Account data? [closed]
- Allow admins to login as other users
- How to change the descriptive text on the menus admin page?
- Given multiple admin accounts, how can I make it so that only admin with X username can edit posts
- How should I setup the “Users” area to hand over to a client?
- Dynamic WordPress Admin Panel
- How to show a custom notification to a specific user?
- Wp-Admin FTPS Connection Error unlike Filezilla
- Want to know who is login Admin/User
- Control Users listed in Users List on dashboard
- How should I change the username of or delete the admin user?
- Prevent Registration Where Role is None?
- Extending the user profile [closed]
- define two login page url
- Newly created user role not displaying on users screen
- How To Remove Import/Export Option From Tools?
- restrict admin panel sections to users
- 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
- WYSIWYG editor not in a post editor?
- 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