woocommerce_terms_is_checked_default

The WooCommerce woocommerce terms is checked default hook.

Description

apply_filters( 'woocommerce_terms_is_checked_default', (bool) $isset ); 

Parameters (1)

0. $isset (bool) => isset( $_POST['terms'] )
The isset.

Usage

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

Defined (1)

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

/templates/checkout/terms.php  
  1. <input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" /> <span><?php printf( __( 'I’ve read and accept the <a href="%s" target="_blank">terms & conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?></span> <span class="required">*</span>