Skip to content

Instantly share code, notes, and snippets.

@justinstern
Created June 3, 2014 15:30
Show Gist options
  • Save justinstern/e83f91be2d6b1d36c179 to your computer and use it in GitHub Desktop.
Save justinstern/e83f91be2d6b1d36c179 to your computer and use it in GitHub Desktop.
<?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' ) );
}
@hazephase
Copy link

This code does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment