• Resolved rigagoogoo

    (@rigagoogoo)


    hi,

    great plugin, really enjoying using it. however I’ve found ‘show’ => ‘from’ does not work as expected. if I create the following connection the to admin box still shows up on all of the CPT’s. It’s not the end of the world it would just help save confusion to be able to remove the admin box….

    p2p_register_connection_type(
       array(
                 'name' => 'stuff_to_stuff',
                 'from' => array('holidays' , 'courses' , 'accommodation',
                                 'gear','companies','experiences'),
                   'to' => array('holidays' , 'courses' , 'accommodation' ,
                                 'gear' , 'companies' , 'experiences'),
                'title' => array('to'   => 'test',
                                 'from' => 'products that are related'),
       'admin_dropdown' => 'any',
       'show'           => 'from'
       )
    );

    cheers
    rigagoogoo

    https://www.ads-software.com/extend/plugins/posts-to-posts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Just to say I encountered the same problem (3.5.1)

    Additionally,
    ‘show’ => ‘false’,
    ‘context’ => ‘advanced’
    … also have no visible either on my setup.

    I guess the quickfix is to set the css to display:none
    The id used to identify the admin box is unique depending on what posttype you are editing. So easy!
    #p2p-to-Session_to_Abstract
    #p2p-from-Session_to_Abstract

    This filter works but removes all admin boxes which isnt quite what I want.
    e.g.
    function restrict_p2p_box_display( $show, $ctype, $post ) {
    if ( ‘ConnectionName’ == $ctype->name && ‘to’ == $ctype->get_direction() ) {
    return 1;
    }

    return 0;
    }

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

    Great Plugin. Just recoded a weeks work having found this gem!

    Plugin Author scribu

    (@scribu)

    It doesn’t work because that’s not the correct syntax.

    Read the wiki page again: https://github.com/scribu/wp-posts-to-posts/wiki/Admin-box-display

    Thanks for the reply. Sorry for missing the obvious !

    Thread Starter rigagoogoo

    (@rigagoogoo)

    ditto, my bad… must have been having a moment of blindness for the nested arrays, thank you for replying ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cannot hide admin box with 'show' => 'from'’ is closed to new replies.