WC_Admin_Notices::no_shipping_methods_notice()public staticWC 1.0

No shipping methods.

Метод класса: WC_Admin_Notices{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WC_Admin_Notices::no_shipping_methods_notice();

Код WC_Admin_Notices::no_shipping_methods_notice() WC 9.4.2

public static function no_shipping_methods_notice() {
        // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	if ( wc_shipping_enabled() && ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) ) {
		$product_count = wp_count_posts( 'product' );
		$method_count  = wc_get_shipping_method_count();

		if ( $product_count->publish > 0 && 0 === $method_count ) {
			include __DIR__ . '/views/html-notice-no-shipping-methods.php';
		}

		if ( $method_count > 0 ) {
			self::remove_notice( 'no_shipping_methods' );
		}
	}
}