I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content.
[my_shortcode post_id=""]
I'm new to PHP and writing shortcodes, this seems as though it should be fairly simple... I know the following is wrong:
function promotion_function($atts) {
extract(shortcode_atts(array(
'promo_id' => '',
), $atts));
global $post;
$meta_values = get_post_custom($promo_id, 'product_desc');
$output = $meta_values;
return $output;
}
add_shortcode('promotion', 'promotion_function');
The above code gives me the string "Array" in my page.
I can't find an example of how to do this, any help would be greatly appreciated.