woocommerce_dismiss_admin_notice_capability

woocommerce_dismiss_admin_notice_capability

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_dismiss_admin_notice_capability') is found 1 times:

  • /includes/admin/class-wc-admin-notices.php line 280
    			 *
    			 * @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 );
    

See this hook used in plugins: