woocommerce_rest_check_permissions

woocommerce_rest_check_permissions

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_rest_check_permissions') is found 5 times:

  • /includes/wc-rest-functions.php line 244
    		$post_type_object = get_post_type_object( $post_type );
    		$permission       = current_user_can( $post_type_object->cap->$cap, $object_id );
    	}
    
    	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, $post_type );
    }
    
    /**
     * Check permissions of users on REST API.
     *
     * @since 2.6.0
    
  • /includes/wc-rest-functions.php line 282
    	} else {
    		$permission = current_user_can( $contexts[ $context ], $object_id );
    	}
    
    	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, 'user' );
    }
    
    /**
     * Check permissions of product terms on REST API.
     *
     * @since 2.6.0
    
  • /includes/wc-rest-functions.php line 307
    	$cap             = $contexts[ $context ];
    	$taxonomy_object = get_taxonomy( $taxonomy );
    	$permission      = current_user_can( $taxonomy_object->cap->$cap, $object_id );
    
    	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, $taxonomy );
    }
    
    /**
     * Check manager permissions on REST API.
     *
     * @since 2.6.0
    
  • /includes/wc-rest-functions.php line 331
    	);
    
    	$permission = current_user_can( $objects[ $object ] );
    
    	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, 0, $object );
    }
    
    /**
     * Check product reviews permissions on REST API.
     *
     * @since 3.5.0
    
  • /includes/wc-rest-functions.php line 364
    	if ( isset( $contexts[ $context ] ) ) {
    		$permission = current_user_can( $contexts[ $context ], $object_id );
    	}
    
    	return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, 'product_review' );
    }
    
    /**
     * Returns true if the current REST request is from the product editor.
     *
     * @since 8.9.0
    

See this hook used in plugins: