woocommerce_product_reviews_page_capability filter-hookWC 6.7.0

Filters whether the current user can manage product reviews.

This is aligned to \wc_rest_check_product_reviews_permissions()


add_filter( 'woocommerce_product_reviews_page_capability', 'wp_kama_woocommerce_product_reviews_page_capability_filter', 10, 2 );

 * Function for `woocommerce_product_reviews_page_capability` filter-hook.
 * @param string $capability The capability (defaults to `moderate_comments` for viewing and `edit_products` for editing).
 * @param string $context    The context for which the capability is needed.
 * @return string
function wp_kama_woocommerce_product_reviews_page_capability_filter( $capability, $context ){

	// filter...
	return $capability;
The capability (defaults to moderate_comments for viewing and edit_products for editing).
The context for which the capability is needed.


Since 6.7.0 Introduced.

Where the hook is called

woocommerce/src/Internal/Admin/ProductReviews/Reviews.php 74
return (string) apply_filters( 'woocommerce_product_reviews_page_capability', $context === 'view' ? 'moderate_comments' : 'edit_products', $context );

Where the hook is used in WooCommerce

Usage not found.