Automattic\WooCommerce\Admin\Notes
CouponPageMoved::can_be_added() public WC 1.0
Checks if a note can and should be added.
{} Это метод класса: CouponPageMoved{}
Хуков нет.
Возвращает
true/false.
Использование
$result = CouponPageMoved::can_be_added();
Код CouponPageMoved::can_be_added() CouponPageMoved::can be added WC 5.0.0
public static function can_be_added() {
if ( ! wc_coupons_enabled() ) {
return false;
}
// Don't add the notice if it's been hidden by the user before.
if ( self::has_dismissed_note() ) {
return false;
}
// If we already have a notice, don't add a new one.
if ( self::has_unactioned_note() ) {
return false;
}
// If new navigation feature is enabled.
if ( Loader::is_feature_enabled( 'navigation' ) ) {
return false;
}
return isset( $_GET[ self::$query_key ] ) && (bool) $_GET[ self::$query_key ]; // phpcs:ignore WordPress.Security.NonceVerification
}