return array instead state - Custom Content Type Manager (2 posts)

  1. rpeixoto
    Posted 3 years ago #

    I have a problem because my template because he's not showing the selected value in the dropdown area of registration, follow the link showing the error:


    State Array

    Rio de Janeiro State

    Code template
    State </ strong> <? php print_custom_field ('estado_uff');?>

    Thank you all!!

  2. fireproofsocks
    Posted 3 years ago #

    If you see "Array" as the output, it means you are storing an Array, i.e. a list of values. You can't simply print an array: you must iterate over each item. Perhaps you defined your field as "repeatable" or perhaps it is a multi-select field. If you didn't mean to store a list of values, then change your field definition and uncheck the "Repeatable" option.

    If you really are supposed to have multiple options, then iterate over the values and print them. You can do this manually (e.g. see http://code.google.com/p/wordpress-custom-content-type-manager/wiki/to_array_OutputFilter), or you can use one of the CCTM's output filters to help, e.g. http://code.google.com/p/wordpress-custom-content-type-manager/wiki/formatted_list_OutputFilter

Topic Closed

This topic has been closed to new replies.

About this Topic