Support

Account

Forum Replies Created

  • @moud,

    You’ll have to loop through array values – for example:

    foreach($field['value'] as $value):
      echo $value . '<br>';
    endforeach;
    

    Or, here’s a function I use often to output a human-readable a comma-separated list:

    // Place in functions.php
    function implode_nice($array, $separator = ', ', $last_separator = ' & ') {
    	if ( count( $array ) == 1 ) {
    		return reset( $array );	
    	}		
    	$end_value = array_pop( $array );				
    	$list = implode( $separator, $array );			
    	return $list . $last_separator . $end_value;			
    }
    
    // Use in template like:
    echo implode_nice($field['value'], ', ', ' and ');
    
  • Check the ‘postmeta’ MySQL table (in phpmyadmin, you can search for it by the post_id).

    One thing I would make sure is that your field has a field reference – this will be another postmeta entry with the same meta_key as your field prefixed with an underscore (e.g. if your field name is “my_field” the reference field meta_key would be “_my_field”). The meta_value of the reference field should be something like “field_2342451923sf” – however, if it is like “temp_key_for_my_field”, your field was not saved/created correctly. If you can verify this is not the case, that would be a good first step.

  • @zquintana,
    Nice workaround and thanks for the info on brackets (seems like PHP is borrowing a thing or two from javascript)

Viewing 3 posts - 51 through 53 (of 53 total)