Automattic\WooCommerce\Internal\Admin\Notes
CouponPageMoved::can_be_added()
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 8.1.1
public static function can_be_added() { if ( ! wc_coupons_enabled() ) { return false; } // Don't add the notice if the legacy coupon menu is already disabled. if ( ! self::should_display_legacy_menu() ) { 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; } return isset( $_GET[ self::$query_key ] ) && (bool) $_GET[ self::$query_key ]; // phpcs:ignore WordPress.Security.NonceVerification }