Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not built in yet, but you can take over the data output using the filter: pods_field_pick_data</p> <pre><code>$data = apply_filters( 'pods_field_pick_data', $data, $name, $value, $options, $pod, $id ); </code></pre> <p>Adding a filter to that filter should give you the ability to change what appears in the drop-down, or other relationship input types.</p> <p>Edit: I just added a similar filter for filtering the autocomplete data too.</p> <pre><code>$pick_data = apply_filters( 'pods_field_pick_data_ajax', array(), $field[ 'name' ], null, $field, $pod, 0, $data ); </code></pre> <p>$data in this array is actually the fully setup PodsData object</p> <p><strong>EDIT (02/07/2013):</strong></p> <p>In Pods 2.3, I've added a quick function that should streamline adding custom relationship objects. This is preferrer over overriding an existing relationship or using the custom simple definition dynamically. Pretty easy to use, check it out at <a href="https://github.com/pods-framework/pods/issues/1033" rel="nofollow">https://github.com/pods-framework/pods/issues/1033</a></p> <pre><code>$options = array( 'group' =&gt; 'Special Relationships', // Whatever you want the selection group to be, defaults to label 'simple' =&gt; false, // Whether this field is related by strings or integer IDs, integer IDs get stored in wp_podsrel, strings are stored in the field itself either serialized (meta-based) or json encoded (table-based) 'data' =&gt; array( // Custom define the items to select from manually 1 =&gt; 'Gravity Form 1', 2 =&gt; 'Gravity Form 2' ), 'data_callback' =&gt; 'get_custom_gravity_forms_list', // Provide a callback function to call to define the data (instead of setting 'data' above) 'value_to_label_callback' =&gt; 'get_custom_gravity_forms_list', // Provide a callback function to define the data when called through PodsField_Pick::value_to_label 'simple_value_callback' =&gt; 'get_custom_gravity_forms_list' // Provide a callback function to define the data when called through PodsField_Pick::simple_value ); pods_register_related_object( 'gravity-form', 'Gravity Forms', $options ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload