WordPress.org

Support

Support » How-To and Troubleshooting » wrap text around custom fields array

wrap text around custom fields array

Viewing 2 replies - 1 through 2 (of 2 total)
  • The print_r() function just dumps out the contents of a variable. To format as you showed in your sample, you will need to have a foreach loop to process each link:

    // Get all custom fields attached to this post and store them in an array
    $custom_fields = base_get_all_custom_fields();
    if( !empty($custom_fields) ) {
       $sep = '';
       foreach ($custom_fields as $key => $value) {
          echo "$sep{image : '$value'};
          $sep = ",\n";
       }
    }
    markoburns
    Member

    @markoburns

    ok, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wrap text around custom fields array’ is closed to new replies.