WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] How to hide post revisions (inherit) in P2P UI (5 posts)

  1. mike235
    Member
    Posted 2 years ago #

    Hi,

    In the Admin UI, when I search for a page/post to connect to, the results also show post revisions (marked "inherit"). I'd like to display only published posts and no revisions, is that possible ?

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    Revisions should have the 'revision' post type. You probably used the Post Type Converter plugin, which doesn't convert revisions properly.

  3. mike235
    Member
    Posted 2 years ago #

    Indeed, the Post Type Switcher plugin has caused many troubles..

    But still, why does P2P show posts other than just "published" ? Is there a way to hide them ?

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    It shows all post statuses, including drafts, pending etc. intentionally.

    You can set a different 'post_status' through the 'p2p_connectable_args' filter:

    https://github.com/scribu/wp-posts-to-posts/wiki/Admin-box-filters

  5. mike235
    Member
    Posted 1 year ago #

    Thanks,

    This solved it :

    function mwm_posts2posts_show_published_only( $args, $ctype, $post_id ) {
    
    	$args['post_status'] = 'publish';
    
    	return $args;
    
    }
    add_filter( 'p2p_connectable_args', 'mwm_posts2posts_show_published_only', 10, 3 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic