[Plugin: OptionTree] Unserialize Meta Box Data
-
If you use the example in Option Tree for the custom meta box for posts or pages you’ll need to use the following to get it to show on both posts and pages:
'pages' => array( 'post', 'page' ),
When you retrieve the custom option within the post Loop you’ll most likely need to unserialize the data if it’s an option type that is stored as an array.
$custom_meta = get_post_custom($post->ID); $background = unserialize($custom['background'][0]);
You can then use the data in the associative array such as the following:
echo $background['background-image'];
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘[Plugin: OptionTree] Unserialize Meta Box Data’ is closed to new replies.