shortcode on "manage custom fields"

This topic contains 1 reply, has 2 voices, and was last updated by  Paolo 10 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #8283

    julian
    Free User
    Post count: 37

    there any way to activate a shortcode from MANAGE CUSTOM FIELDS PLACE?
    i’ve tried on a html field, but i get this result, like plain text:
    Thanks

    #8303

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    By default, WordPress do not allows shortcodes to be executed inside custom fields.

    If the custom field wasn’t dynamically generated, but “hardcoded” in a template, you could change the normal php snippet that outputs the custom field:

    
    
    <?php echo get_post_meta($post->ID, 'your_custom_field_here', true); ?>
    

    with this:

    <?php echo apply_filters('the_content', get_post_meta($post->ID, 'your_custom_field_here', true)); ?>

    But in this case, enabling shortcodes in custom fields is much more complex and not something I’d personally know how to do…

    I’ll ask Vikas to tell us if there is an easy way or not.

    Thx

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount