Custom WooCommerce shortcodes class loading https://www.skyverge.com/blog/how-to-override-woocommerce-template-files/
<?php | |
// add the following to the bottom of your functions.php | |
// assumes a copy of the core class-wc-shortcodes.php, customized, is available at path/to/custom/class-wc-shortcodes.php | |
add_action( 'woocommerce_loaded', 'use_custom_wc_shortcodes' ); | |
function use_custom_wc_shortcodes() { | |
// load our custom shortcodes class | |
include_once( 'path/to/custom/class-wc-shortcodes.php' ); | |
// unhook the standard woocommerce one | |
remove_action( 'init', array( 'WC_Shortcodes', 'init' ) ); | |
// hook in ours | |
add_action( 'init', array( 'WC_Custom_Shortcodes', 'init' ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
This code does not work