Menu

#1 Optionally parse shortcodes in other fields

Accepted
nobody
None
Medium
Enhancement
2011-10-29
2011-10-29
Anonymous
No

Originally created by: fireproofsocks
Originally owned by: fireproofsocks

Normally, shortcodes are only parsed inside of the post content.

E.g. for custom fields, it's as simple as this:
`echo do_shortcode(get_post_meta($post->ID, 'custom_field', true));`

See:
http://nspeaks.com/978/insert-shortcodes-into-your-custom-fields/

We should be able to add filters to the_title, the_excerpt, etc.:
`add_filter( 'the_title', 'parse_shortcodes' );`

It'd be really handy to be able to filter custom fields as well:
http://wordpress.org/support/topic/filter-custom-fields-post-meta?replies=4

Discussion


Log in to post a comment.

MongoDB Logo MongoDB