• Resolved Tim Berneman

    (@tberneman)


    I’ve created a dropdown list using a Taxonomy. You allow the Value of “Name” or “ID”, can you add “Slug” to the list? This would be tremendously helpful! While you are at it, you may want to add “Description” to the list as well to cover all your bases. ??

    In my current project I have 175 document types (ex: “Warranty Deed”) which has an id of “1154” and a slug of “wdeed”, and I need slug! Otherwise, I have to have an array of all the 175 names and slugs in my called program to get the slug value. THANKS!

    https://www.ads-software.com/plugins/caldera-forms/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Josh Pollock

    (@shelob9)

    The value can be any field of the taxonomy, including slug if you use the filter caldera_forms_autopopulate_options_taxonomy_value_field. Check out the second code example here:

    See: https://calderawp.com/doc/customizing-auto-populated-field-options-in-caldera-forms/

    Thread Starter Tim Berneman

    (@tberneman)

    Using your example all I had to do was change the taxonomy name:

    add_filter( ‘caldera_forms_autopopulate_options_taxonomy_value_field’, function( $value_field, $field ) {
    if( ‘doc_types’ == $field[ ‘slug’ ] ) {
    $value_field = ‘slug’;
    }
    return $value_field;
    }, 24, 2 );

    So should I see “Slug” in the list of Values with ID and Name because I don’t. Also, I don’t see a php variable with my slug in my called program.

    Thread Starter Tim Berneman

    (@tberneman)

    Bump. Any help for me on this? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Auto Type Taxonomy – Please add Value "Slug"’ is closed to new replies.