wordpress custom shortcode not working
-
Hi I had created a custom billing field shipping tracking code to add shipping tracking number to the order in the backend and send this info by woocommerce order email to customer automatically returning this value as short code in html. But it doesnt work. What is wrong? Please help.
/** * Add Shortcode */ function tracking_shortcode( ) { $order = new WC_Order( $order_id ); $shipping_tracking_code = get_post_meta( $order->id, '_shipping_tracking_code', true ); ob_start(); return $shipping_tracking_code; return ob_get_clean(); } add_shortcode( 'tracking_code', 'tracking_shortcode' );
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘wordpress custom shortcode not working’ is closed to new replies.