How to show only the author's posts in PODS Relationship Custom Field
-
Hi,
I created a Relationship Custom Field in PODS, where the users can see and select a post from another custom post type (for eg. products). The problem is that I have a thousands of posts and for the users it’s a bad experience to search dozens of items until finding their posts.Is there any solution that users should be able to see only the pots created by them?
[IMG]https://i58.tinypic.com/258as9f.png[/IMG]I already put the following code in my functions.php but it’s not working for this custom field:
function mypo_parse_query_useronly( $wp_query ) {
if ( strpos( $_SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/edit.php’ ) !== false ) {
if ( !current_user_can( ‘update_core’ ) ) {
global $current_user;
$wp_query->set( ‘author’, $current_user->id );
}
}
}add_filter(‘parse_query’, ‘mypo_parse_query_useronly’ );
Many, many thanks in advance!
Regards,
Burebista
- The topic ‘How to show only the author's posts in PODS Relationship Custom Field’ is closed to new replies.