woocommerce_product_backorders_allowed

Returns whether or not the product can be backordered.

Description

apply_filters( 'woocommerce_product_backorders_allowed', (unknown) $yes_this_get_backorders_notify_this_get_backorders, (unknown) $this_get_id, (unknown) $instance ); 

Parameters (3)

0. $yes_this_get_backorders_notify_this_get_backorders — Optional. (unknown) => ( 'yes' === $this->get_backorders() || 'notify' === $this->get_backorders() )
The yes this get backorders notify this get backorders.
1. $this_get_id (unknown)
The this get id.
2. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/includes/abstracts/abstract-wc-product.php  
  1. return apply_filters( 'woocommerce_product_backorders_allowed', ( 'yes' === $this->get_backorders() || 'notify' === $this->get_backorders() ), $this->get_id(), $this );