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)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Enable shortcode for custom field’ is closed to new replies.