woocommerce_dismiss_admin_notice_capability

woocommerce_dismiss_admin_notice_capability

Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.6.9.0

apply_filters('woocommerce_dismiss_admin_notice_capability') is found 1 times:

  • /includes/admin/class-wc-admin-notices.php line 182
    			 *
    			 * @param string $default_capability The default required capability.
    			 * @param string $notice_name The notice name.
    			 */
    			$required_capability = apply_filters( 'woocommerce_dismiss_admin_notice_capability', 'manage_woocommerce', $notice_name );
    
    			if ( ! current_user_can( $required_capability ) ) {
    				wp_die( esc_html__( 'You don’t have permission to do this.', 'woocommerce' ) );
    			}
    
    			self::hide_notice( $notice_name );