woocommerce_api_check_permission

The WooCommerce woocommerce api check permission hook.

Description

apply_filters( 'woocommerce_api_check_permission', (unknown) $permission, (unknown) $context, (unknown) $post, (unknown) $post_type ); 

Parameters (4)

0. $permission (unknown)
The permission.
1. $context (unknown)
The context.
2. $post (unknown)
The post.
3. $post_type (unknown)
The post type.

Usage

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

Defined (1)

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

/includes/api/legacy/v3/class-wc-api-resource.php  
  1. return apply_filters( 'woocommerce_api_check_permission', $permission, $context, $post, $post_type );