WordPress.org

Forums

Posts 2 Posts
[resolved] metdata between associated post types (3 posts)

  1. Jonathan Dingman
    Member
    Posted 3 years ago #

    I'm trying to figure out how ot add metadata between post types.

    For example,

    PostType1 = Person1
    PostType2 = Product1, Product2, Product3

    Person1 is a..

    Manager, Product1
    Support, Product2
    Engineer, Product3

    Basically being able to associate a "title" with the their role over the product.

    After looking at the documentation, it looks like I might need to use "Special" to accomplish this.

    Is this the best route to use? Or is there a better way to accomplish this.

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

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    'special' is just an arbitrary connection field key. What you need is a plain text field:

    p2p_register_connection_type( array(
    
    	...
    
    	'fields' => array(
    		'role' => array(
    			'title' => 'Role',
    			'type' => 'text',
    		)
    	)
    ) )

    Either that, or a 'select' field. See 'role' in the wiki.

  3. Jonathan Dingman
    Member
    Posted 3 years ago #

    PERFECT!

    I even got the data to display correctly using the examples.

    Great work again on the plugin, awesome job :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags