php - Remove and Override WooCommerce Process Registration action -
i'm developing plugin customise woocommerce registration , trying avoid direct editing of core files.
i need override or replace process_registration
action in woocommerces includes/class-wc-form-handler.php
file through plugin.
add_action( 'init', array( $this, 'process_registration' ) );
i tried following links, didn't work. also, files mentioned on pages doesn't exist on woocommerce current version. checked woocommerce documentation, seems don't have hook that.
woocommerce hooks: http://docs.woothemes.com/document/hooks/
i'd appreciate help!
two options , considering wc method starts like:
class wc_form_handler public function __construct() { add_action( 'init', array( $this, 'process_registration' ) ); } public function process_registration() { if ( ! empty( $_post['register'] ) ) { wp_verify_nonce( $_post['register'], 'woocommerce-register' ); # etc } } } new wc_form_handler();
add
init
hook top priority , duplicateunset($_post['register'])
. wc doesn't specify priority, it's running on 10, default.add_action( 'init', function() { /* dup, unset, thing */ }, 1 ); // priority 1
track down evil anonymous object woo hidding hook, can:
// pseudo code, go wpse real thing remove_hook( 'init', 'woo_process_registration' );
Comments
Post a Comment