I've created a hierarchical post type called "Groups" that obviously will have parent and children pages. "Groups" has a post relationship with another post type "People". When I go to create a new People post is there a way to only show the parent items from my "Groups" post type in the drop down?
Hi brianG-4,
It is not possible within current version of Types, and I put it into our to-do list as a feature request. our developers will take care of it.
Thanks! Typically, what's the time-frame for new features to get added? Are we talking weeks? months?
Sorry, I am not sure when will it be applied into Types plugin, if you need, there is a workarround:
1) modify the Types plugin file \wp-content\plugins\wp-types\embedded\includes\post-relationship.php, line 290
From:
To:
'suppress_filters' => 0,
'post_parent' => apply_filters( 'wpcf_pr_belongs_post_parent', null, $type, $post),
2) add codes in your theme/functions.php:
add_filter( 'wpcf_pr_belongs_post_parent', 'parent_items_func', 10, 3 );
function parent_items_func($post_parent, $post_type, $post){
if(is_admin() && $post_type == 'groups' && get_post_type($post->ID)=='people'){
$post_parent = 0;
}
return $post_parent;
}
Please replace "groups" with the slug of post type "Groups", and replace "people" with the slug of post type "People"