WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms + Custom Post Types
Terms displayed as IDs, not Name (8 posts)

  1. Steven Jones
    Member
    Posted 1 year ago #

    Hi,

    When a form is submitted the terms have been added via a select form, these terms are shown as numbers on entries screen.

    How would I get it to display the term name instead please?

    Cheers,
    Steve

    http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/

  2. philallum
    Member
    Posted 1 year ago #

    Hi

    I'm having the same problem with this plugin, does anyone have a solution

    Thanks
    Phil

  3. dashaluna
    Member
    Posted 1 year ago #

    Hello,

    Similar problem. Does any one figured out how to display term names in the Entries of the form submission rather terms IDs?

    Many thanks, Dasha

  4. Steven Jones
    Member
    Posted 1 year ago #

    Unfortunately you can't unless you alter the code.

    Hopefully the plugin author will take a look at this soon.

  5. dashaluna
    Member
    Posted 1 year ago #

    @Steve, thanks for letting me know. I was wondering if you edit the code? If so, could you give any pointers what function you altered and how?

    Many thanks in advance,
    Dasha

  6. dashaluna
    Member
    Posted 1 year ago #

    Hello,

    I figured out how to display text for checkboxes/select/radio inputs in the admin Entry view via filters rather than altering the plugin code.

    Add the following code to your functions.php

    add_filter( 'gform_entry_field_value', 'admin_entry_view_display_pretty_text', 10, 4);
    function admin_entry_view_display_pretty_text( $display_value, $field, $lead, $form ){
    	$field_type = RGFormsModel::get_input_type($field);
    
    	if( in_array( $field_type, array('checkbox', 'select', 'radio') ) ){
    		$value = RGFormsModel::get_lead_field_value( $lead, $field );
    		return GFCommon::get_lead_field_display( $field, $value, $lead["currency"], true );
    	}
    	else{
    		return $display_value;
    	}
    }

    I hope that helps someone.
    Dasha

  7. Adam Robertson
    Member
    Posted 10 months ago #

    dashaluna, thank you, that filter worked perfectly for what I needed: it displays the title rather than the ID in the Admin Entry.

  8. cquinndesign
    Member
    Posted 8 months ago #

    Am I supposed to change something in this code? For instance, am I supposed to put the field name somewhere for which I want to apply this function to?

    I can't get it to work :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.