WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Limit connection type by template via from_query_vars (3 posts)

  1. jtredway
    Member
    Posted 2 years ago #

    First of all, this plugin rocks!

    Second, is it possible to restrict a connection type via "from_query_vars" wherein the "meta_key" is "_wp_page_template"?

    For example, is something like the following possible:

    p2p_register_connection_type( array(
    		'id' => 'landing2page',
    		'from' => 'page',
    		'from_query_vars' => array(
    			'meta_key' => '_wp_page_template',
    			'meta_value' => 'template-landing-list.php'
    		),
    		'to' => 'page',
    		'title' => 'Show Which Pages?'
    	) );

    In the above example, I'm trying to get the connection box to only appear on the admin screen for pages which have been assigned a specific template?

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

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    That would mean that the box won't show up when you go to create a new page, since it won't have a template assigned to it until it's saved.

  3. jtredway
    Member
    Posted 2 years ago #

    I went ahead and added some JavaScript to hide/show the connection box on the fly whenever the the template is selected or previously assigned.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic