WordPress.org

Ready to get started?Download WordPress

Forums

Shortcodes in Custom fields (2 posts)

  1. dompl
    Member
    Posted 3 years ago #

    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

  2. dompl
    Member
    Posted 3 years ago #

    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;

Topic Closed

This topic has been closed to new replies.

About this Topic