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.

http://wordpress.org/support/topic/overriding-woocommerce_process_registration-in-child-theme-functionsphp

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(); 
  1. add init hook top priority , duplicate unset($_post['register']). wc doesn't specify priority, it's running on 10, default.

    add_action( 'init', function() { /* dup, unset, thing */ }, 1 ); // priority 1 
  2. track down evil anonymous object woo hidding hook, can:

    // pseudo code, go wpse real thing remove_hook( 'init', 'woo_process_registration' ); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -