Support

Account

Home Forums Backend Issues (wp-admin) Relationship set to one post type showing all post types in selection.

Solved

Relationship set to one post type showing all post types in selection.

  • I’ve setup a relationship field that should only allow for selection from a single post type (team, aka Team Members):

    However, in the post admin selection itself, ALL post types are displaying:

    When I select a taxonomy related to the team post type, that filter works, but I need to be able to select from posts without taxonomy entries.

    Troubleshooting that didn’t help:
    -changing field name
    -all combinations of options to show/hide search, post type, featured image, etc
    -deleting field, saving fieldset, adding field again
    -trying all post types, singular and multiple
    -associating relationship field with a different post type admin (same issues)
    -updating CPT Plugin and wordpress installs

  • Hi @shauniqua

    I’m afraid I can’t reproduce this issue on my end. It’s possible that you have a custom function or a conflict that causes this issue. Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Fifteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    Thanks!

  • Yep, turned out to be a custom function that was filtering search sitewide…

    
    // search post types
    function filter_search($query) {
        if ($query->is_search) {
    		$query->set('post_type', array('post', 'project', 'team', 'perspective'));
        };
        return $query;
    };
    add_filter('pre_get_posts', 'filter_search');

    Everything’s in order when I comment it out. Cheers!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Relationship set to one post type showing all post types in selection.’ is closed to new replies.