woocommerce_checkout_registration_enabled

Is registration enabled on the checkout page?.

Description

(boolean) apply_filters( 'woocommerce_checkout_registration_enabled', (string) $yes_get_option_woocommerce_enable_signup_and_login_from_checkout ); 

Returns (boolean)

Parameters (1)

0. $yes_get_option_woocommerce_enable_signup_and_login_from_checkout — Optional. (string) => 'yes' === get_option( 'woocommerce_enable_signup_and_login_from_checkout' )
The yes get option woocommerce enable signup and login from checkout.

Usage

To run the hook, copy the example below.
  1. $yes_get_option_woocommerce_enable_signup_and_login_from_checkout = apply_filters( 'woocommerce_checkout_registration_enabled', $yes_get_option_woocommerce_enable_signup_and_login_from_checkout ); 
  2.  
  3. if ( !empty( $yes_get_option_woocommerce_enable_signup_and_login_from_checkout ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_checkout_registration_enabled callback 
  2. function filter_woocommerce_checkout_registration_enabled( $yes_get_option_woocommerce_enable_signup_and_login_from_checkout ) { 
  3. // make filter magic happen here... 
  4. return $yes_get_option_woocommerce_enable_signup_and_login_from_checkout
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_checkout_registration_enabled', 'filter_woocommerce_checkout_registration_enabled', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_checkout_registration_enabled', 'filter_woocommerce_checkout_registration_enabled', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-checkout.php  
  1. return apply_filters( 'woocommerce_checkout_registration_enabled', 'yes' === get_option( 'woocommerce_enable_signup_and_login_from_checkout' ) );