本文整理匯總了PHP中WC_Admin_Notices::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Admin_Notices::init方法的具體用法?PHP WC_Admin_Notices::init怎麽用?PHP WC_Admin_Notices::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WC_Admin_Notices
的用法示例。
在下文中一共展示了WC_Admin_Notices::init方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: no_shipping_methods_notice
public static function no_shipping_methods_notice()
{
if (wc_shipping_enabled() && (empty($_GET['page']) || empty($_GET['tab']) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'])) {
global $wpdb;
$product_count = wp_count_posts('product');
$method_count = wc_get_shipping_method_count();
if ($product_count->publish > 0 && 0 === $method_count) {
include 'views/html-notice-no-shipping-methods.php';
}
if ($method_count > 0) {
self::remove_notice('no_shipping_methods');
}
}
}
/**
* Simplify Commerce is being removed from core.
*/
public static function simplify_commerce_notice()
{
$location = wc_get_base_location();
if (class_exists('WC_Gateway_Simplify_Commerce_Loader') || !in_array($location['country'], apply_filters('woocommerce_gateway_simplify_commerce_supported_countries', array('US', 'IE')))) {
self::remove_notice('simplify_commerce');
return;
}
if (empty($_GET['action'])) {
include 'views/html-notice-simplify-commerce.php';
}
}
}
WC_Admin_Notices::init();