WordPress.org

Forums

Pods - Custom Content Types and Fields
[resolved] Relationship field - customise the display text (3 posts)

  1. mondocongo
    Member
    Posted 2 years ago #

    I have an "appointments" post type which has a relationship field linked to the post type "providers" - providers doesn't use a WordPress 'title' field.

    When creating an appointment, the providers all display as 'Auto draft' in the select list.

    Is there a way to override the display text when in a select list? I have already overridden "the_title()", however this doesn't seem to have an effect on the select list representation.

    I'm using the latest version of Pods 2.

    http://wordpress.org/extend/plugins/pods/

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 2 years ago #

    I'm adding a new filter into Pods 2.0.5 which should get committed today or tomorrow.

    The filter is called "pods_field_pick_data" and it passes 6 variables:

    $data = the array of key / value pairs for display
    $name = the field input name
    $value = the current field value
    $options = the field data and options
    $pod = the Pod object (if passed to the field method)
    $id = the Pod item ID (if passed to the field method)

    We're also working on a new option that will let you customize which field is shown for the title on relationship fields, that may or may not be ready for 2.0.5 in time.

  3. mondocongo
    Member
    Posted 2 years ago #

    Awesome... just updated to 2.0.5-b-3 and hooked it up.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic