简体   繁体   中英

How to use a php value in wordpress do shortcode function?

I have a meta box in my custom post type that will return a shortcode like [jwp-video n="1"] so I want to display my shortcode in my theme . (here is showing video using jw player). I get the metabox value this way:

 <?php $value = get_post_meta( get_the_ID(), 'metabox_id', true ); ?> 

and I know this function:

 <?php <?php echo do_shortcode("[shortcode]"); ?> ?> 

but how can I use my $value in this function to display shortcode ?

您注册了简码吗?

add_shortcode('your_shortcode', 'callback_function');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM