WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rpeixoto
    Member
    Posted 1 year 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:

    http://carvaoalvinegro.com.br/site/clientes/rodrigo-peixoto/

    error:
    State Array

    correct:
    Rio de Janeiro State

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

    Thank you all!!

  2. fireproofsocks
    Member
    Posted 1 year 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