Title: [Plugin: Posts 2 Posts] fields API with select box
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] fields API with select box

 *  [twaiiiin](https://wordpress.org/support/users/monsieurt/)
 * (@monsieurt)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/fields-api-with-select-box/)
 * Hi,
 * First, I really love your plugin – thanks you very much for your efforts to the
   community !
 * I have a quick question…
    Would it be possible to enhanced ‘fields’ API to insert
   a select box instead of the input text ? Something like that…
 *     ```
       register_connection_type( array(
           'from' => 'post',
           'to' => 'page',
   
           'fields' => array(
               'foo' => array(
                   'title' => 'Foo',
                   'type' => 'select'
               ),
               'bar' => array(
                   'title' => 'Bar',
                   'type' => 'date',
                   'default' => 'current date'
               )
           )
       ) );
       ```
   
 * OR…
    Would it be possible to enhanced ‘fields’ API to populate a field with a
   custom taxonomy to create a select box instead of the input text ? Something 
   like that…
 * For example using your movie/actor demo…
    Let’s say we had a taxonomy type called‘
   roles’: leading actor, cameo, etc.
 *     ```
       p2p_register_connection_type( array(
       	'from' => 'actor',
       	'to' => 'movie',
   
       	'fields' => array(
                   'role' => array(
                       'title' => 'Role',
                        'type' => 'select'
                        'values' => 'array('taxonomy roles');
                   ),
                   'date' => array(
                       'title' => 'Date',
                       'type' => 'date',
                       'default' => 'current date'
                   )
       	)
       ) );
       ```
   
 * Would this be possible ?
    Thanks you very much again !

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/fields-api-with-select-box/#post-2135247)
 * Being able to display a dropdown instead of a text field is one of the things
   that the fields API is meant to do, but it’s not implemented yet.
 * Note that the field values are meant to go on the connection itself, not on the
   post it’s connected to, so I’m not sure how using taxonomy terms would fit into
   that.
 *  Thread Starter [twaiiiin](https://wordpress.org/support/users/monsieurt/)
 * (@monsieurt)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/fields-api-with-select-box/#post-2135262)
 * Thank you a lot for your answer.
 * Forget about the taxonomy, i’m not sure it’s very useful. I haven’t thought enough
   about that. But the basic field API would offer a lot of opportunities.
 *     ```
       p2p_register_connection_type( array(
       	'from' => 'post',
       	'to' => 'page',
       	'fields' => array(
                   'role' => array(
                       'title' => 'Role',
                        'type' => 'select'
                        'values' => 'array('array of value');
                   )
       	)
       ) );
       ```
   
 * I can’t wait to use this feature.
    Thanks you very much for your efforts !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Posts 2 Posts] fields API with select box’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [twaiiiin](https://wordpress.org/support/users/monsieurt/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/fields-api-with-select-box/#post-2135262)
 * Status: not resolved