woocommerce_rest_suppress_image_upload_error

The WooCommerce woocommerce rest suppress image upload error hook.

Description

apply_filters( 'woocommerce_rest_suppress_image_upload_error', (bool) $false, (unknown) $upload, (unknown) $product_get_id, (unknown) $images ); 

Parameters (4)

0. $false (bool) => false
The false.
1. $upload (unknown)
The upload.
2. $product_get_id (unknown)
The product get id.
3. $images (unknown)
The images.

Usage

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

Defined (2)

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

/includes/api/v1/class-wc-rest-products-controller.php  
  1. if ( ! apply_filters( 'woocommerce_rest_suppress_image_upload_error', false, $upload, $product->get_id(), $images ) ) { 
/includes/api/class-wc-rest-products-controller.php  
  1. if ( ! apply_filters( 'woocommerce_rest_suppress_image_upload_error', false, $upload, $product->get_id(), $images ) ) {