woocommerce_duplicate_product_capability

Show the "Duplicate" link in admin products list.

Description

(array) apply_filters( 'woocommerce_duplicate_product_capability', (string) $manage_woocommerce ); 

Returns (array)

Parameters (1)

0. $manage_woocommerce (string) => 'manage_woocommerce'
The manage woocommerce.

Usage

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

Defined (2)

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

/includes/admin/class-wc-admin-duplicate-product.php  
  1. if ( ! current_user_can( apply_filters( 'woocommerce_duplicate_product_capability', 'manage_woocommerce' ) ) ) { 
  1. if ( ! current_user_can( apply_filters( 'woocommerce_duplicate_product_capability', 'manage_woocommerce' ) ) ) {