Reviews::get_capability()public staticWC 1.0

Gets the required capability to access the reviews page and manage product reviews.

Method of the class: Reviews{}




$result = Reviews::get_capability( $context ) : string;
The context for which the capability is needed (e.g. view or moderate).
Default: 'view'

Reviews::get_capability() code WC 8.9.0

public static function get_capability( string $context = 'view' ) : string {

	 * Filters whether the current user can manage product reviews.
	 * This is aligned to {@see \wc_rest_check_product_reviews_permissions()}
	 * @since 6.7.0
	 * @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) apply_filters( 'woocommerce_product_reviews_page_capability', $context === 'view' ? 'moderate_comments' : 'edit_products', $context );