Created
February 26, 2016 11:35
-
-
Save mikejolley/9f4b2c050fffee6e1eca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'custom_product_price', 'custom_product_price_shortcode' ); | |
function custom_product_price_shortcode( $atts ) { | |
if ( empty( $atts ) ) { | |
return ''; | |
} | |
if ( isset( $atts['id'] ) ) { | |
$product = wc_get_product( $atts['id'] ); | |
return $product->get_price_html(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment