Title: [Plugin: Custom Content Type Manager] Multi-select output to array doesn&#039;t make array
Last modified: August 20, 2016

---

# [Plugin: Custom Content Type Manager] Multi-select output to array doesn't make array

 *  Resolved [GreyhoundXX](https://wordpress.org/support/users/greyhoundxx/)
 * (@greyhoundxx)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-multi-select-output-to-array-doesnt-make-array/)
 * I have a custom field set up as a multi-select with checkbox and the output filter
   is “Array (to_array)”. However, when I use get_post_meta I end up with a string.
   For example, I have people check off days of the week.
 * This is how I get the field in my loop:
 * `$days = get_post_meta($post->ID, ‘days’, 0);
 * When I print it out, I get this, which is an array of 1:
 * Array ( [0] => [“Monday”,”Tuesday”,”Wednesday”,”Thursday”,”Friday”] )
 * Is there any way to fix this without doing a bunch of str_replace and explode?
 * [http://wordpress.org/extend/plugins/custom-content-type-manager/](http://wordpress.org/extend/plugins/custom-content-type-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-multi-select-output-to-array-doesnt-make-array/#post-2954158)
 * If you use get_post_meta, then you are bypassing any of CCTM’s filters — you’re
   missing out on half the goods. CCTM includes 2 functions to help avoid all that
   trouble: **get_custom_field()** and **print_custom_field()** : see [http://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_custom_field](http://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_custom_field)
 * So in your template you might do something like this:
 *     ```
       <?php
       $days = get_custom_field('days:to_array');
       print implode(', ', $days);
       ?>
       ```
   
 * Or perhaps even simpler, use the formatted_list output filter: [http://code.google.com/p/wordpress-custom-content-type-manager/wiki/formatted_list_OutputFilter](http://code.google.com/p/wordpress-custom-content-type-manager/wiki/formatted_list_OutputFilter)
 *     ```
       <?php
       print_custom_field('days:formatted_list', ', ');
       ?>
       ```
   
 * There are lots of docs on the project’s wiki, and there are sample templates 
   generated for you when you view any of your defined content types. Have a look
   around — I really tried my best to solve as many of these mundane problems for
   you.
 *  Thread Starter [GreyhoundXX](https://wordpress.org/support/users/greyhoundxx/)
 * (@greyhoundxx)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-multi-select-output-to-array-doesnt-make-array/#post-2954159)
 * Thank for your response – that makes sense. Usually I have to hack my way around
   things so I wasn’t expecting you to include an easier way of getting the array.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Custom Content Type Manager] Multi-select output to array doesn't
make array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [GreyhoundXX](https://wordpress.org/support/users/greyhoundxx/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-multi-select-output-to-array-doesnt-make-array/#post-2954159)
 * Status: resolved