WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Posts 2 Posts] Limit connection type by template via from_query_vars

[Resolved] [Plugin: Posts 2 Posts] Limit connection type by template via from_query_vars

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu
    Member

    @scribu

    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.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: Posts 2 Posts] Limit connection type by template via from_query_vars’ is closed to new replies.