Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// 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' ) );

This comment has been minimized.

Copy link

hazephase commented Jun 19, 2017

This code does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.