wc_product_has_unique_sku
The WooCommerce wc product has unique sku hook.
Description
apply_filters( 'wc_product_has_unique_sku', (unknown) $sku_found, (unknown) $product_id, (unknown) $sku );
Parameters (3)
- 0. $sku_found (unknown)
- The sku found.
- 1. $product_id (unknown)
- The product id.
- 2. $sku (unknown)
- The sku.
Usage
- To run the hook, copy the example below.
- $sku_found = apply_filters( 'wc_product_has_unique_sku', $sku_found, $product_id, $sku );
- if ( !empty( $sku_found ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wc_product_has_unique_sku callback
- function filter_wc_product_has_unique_sku( $sku_found, $product_id, $sku ) {
- // make filter magic happen here...
- return $sku_found;
- };
- // add the filter
- add_filter( 'wc_product_has_unique_sku', 'filter_wc_product_has_unique_sku', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wc_product_has_unique_sku', 'filter_wc_product_has_unique_sku', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /includes/wc-product-functions.php
- if ( apply_filters( 'wc_product_has_unique_sku', $sku_found, $product_id, $sku ) ) {