Title: Enable shortcode for custom field
Last modified: August 30, 2016

---

# Enable shortcode for custom field

 *  [ikramy](https://wordpress.org/support/users/ikramy/)
 * (@ikramy)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/enable-shortcode-for-custom-field/)
 * Hi,
 * I just added a custom field and an extra product tab for woocommerce, and I need
   to enable shortcodes in that new custom field.
 * Below is my code:
 *     ```
       add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab_whatsincluded' );
       function woo_new_product_tab_whatsincluded( $tabs ) {
       	$tabs['report_whatsincluded_tab'] = array(
       		'title' 	=> __( "What's Included", 'woocommerce' ),
       		'priority' 	=> 50,
       		'callback' 	=> 'woo_new_product_tab_whatsincluded_content'
       	);
       	return $tabs;
       }
       function woo_new_product_tab_whatsincluded_content() {
           global $wp_query;
           $post_id = $wp_query->post->ID;
       	echo wp_specialchars( get_post_meta( $post_id, "What's Included", true ), 1 );
       }
       ```
   
 * Any idea?

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

 *  [mrjhon01](https://wordpress.org/support/users/mrjhon01/)
 * (@mrjhon01)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/enable-shortcode-for-custom-field/#post-6387345)
 * $post_id = $wp_query->post->ID; I think this one made an error. Just remove the
   post $post_id = $wp_query->ID;
 * If not work. Make sure you see how to work with wp_query
 *  Thread Starter [ikramy](https://wordpress.org/support/users/ikramy/)
 * (@ikramy)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/enable-shortcode-for-custom-field/#post-6387412)
 * Hi mrjhon01,
 * I don’t think there is an issue with the post ID, the date gets pulled without
   issues.
 * All I need to do is to execute shortcodes for custom fields.
 * Thanks

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

The topic ‘Enable shortcode for custom field’ is closed to new replies.

## Tags

 * [custom tags](https://wordpress.org/support/topic-tag/custom-tags/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ikramy](https://wordpress.org/support/users/ikramy/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/enable-shortcode-for-custom-field/#post-6387412)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
