WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
retrieving fields' names instd of slugs (2 posts)

  1. lucaboccianti
    Member
    Posted 1 year ago #

    hello,

    I use this code to obtain a list of label-values to build a table:

    $field_group_values = simple_fields_fieldgroup('scheda_tecnica');
    
    foreach($field_group_values as $key => $value) {
      echo '<div class="label">' . $key . '</div>';
      echo '<div class="value">' . $value . '</div>';
    }

    the problem is that in $key I obtain the slug for the field, something ugly with undercores etc., while I'd prefer to obtain the nice name of the field.

    is that possibile? I have the sensation I'm missing something obvious.

    thanks.

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    Can you try to pass "extended_return=1" as second arg, like:

    $field_group_values = simple_fields_fieldgroup('scheda_tecnica');

    I don't remember exactly how the output is, but perhaps that fixes it. Otherwise I may be able to add another argument that fixes that. Let me know if the above works first however!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags