woocommerce_dismiss_admin_notice_capability хук-фильтрWC 6.7.0

Filter the capability required to dismiss a given notice.

Использование

add_filter( 'woocommerce_dismiss_admin_notice_capability', 'wp_kama_woocommerce_dismiss_admin_notice_capability_filter', 10, 2 );

/**
 * Function for `woocommerce_dismiss_admin_notice_capability` filter-hook.
 * 
 * @param string $default_capability The default required capability.
 * @param string $notice_name        The notice name.
 *
 * @return string
 */
function wp_kama_woocommerce_dismiss_admin_notice_capability_filter( $default_capability, $notice_name ){

	// filter...
	return $default_capability;
}
$default_capability(строка)
The default required capability.
$notice_name(строка)
The notice name.

Список изменений

С версии 6.7.0 Введена.

Где вызывается хук

WC_Admin_Notices::hide_notices()
woocommerce_dismiss_admin_notice_capability
woocommerce/includes/admin/class-wc-admin-notices.php 182
$required_capability = apply_filters( 'woocommerce_dismiss_admin_notice_capability', 'manage_woocommerce', $notice_name );

Где используется хук в WooCommerce

Использование не найдено.