Support » Plugins » Shortcodes in Custom fields

  • dompl

    (@dompl)


    HI there.

    Im using on my site Audio Player plugin and trying to add mp3 files in the Custom Fields.

    Here is my code for the Custom Fields.

    $values = get_post_custom_values('Sample');
    if (isset($customField[0])) {
    $shortcode_output = do_shortcode($values[0]);
    print $shortcode_output;

    Unfortunately this does not work. Not sure why.

    Any help much appreciated.

    Thanks in advance

    dompl

Viewing 1 replies (of 1 total)
  • dompl

    (@dompl)

    Ok I think I’ve answered myself. :

    $values = get_post_custom_values('Sample');
    if (isset($customField[0])) {
    $shortcode_output = apply_filters('the_content', get_post_meta($post->ID, 'Sample', true));
    echo $shortcode_output;
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcodes in Custom fields’ is closed to new replies.