WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Posts 2 Posts] Custom admin boxes example mess up WP_Query

[Plugin: Posts 2 Posts] Custom admin boxes example mess up WP_Query

  • Hi, I’m not sure if this is my fault. When I tried the example code in https://github.com/scribu/wp-posts-to-posts/wiki/Custom-admin-boxes it work nicely, except the editor ended up displaying the content (text content, title and permalink) of the linked post instead of the one I’m editing, and if I click update, it will save the displayed data over the current post.

    I’m using p2p to link subpost() to post. This is my setup

    p2p_register_connection_type(
    		array(
    			'name' => 'subpost_to_post',
    			'from' => 'subpost',
    			'to' => 'post',
    			'cardinality' => 'many-to-one',
    			'admin_box' => 'false',
    			'admin_column' => 'any',
    		)
    	);

    Everything else as per the example.

    Everything back to normal if I comment out p2p_list_posts( p2p_type( 'posts_to_pages' )->get_connected( $post->ID ) );

    Do I need to call something to flush or reset WP_Query after using p2p?

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

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Posts 2 Posts] Custom admin boxes example mess up WP_Query’ is closed to new replies.