本文整理汇总了PHP中WC_Subscriptions::cache方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions::cache方法的具体用法?PHP WC_Subscriptions::cache怎么用?PHP WC_Subscriptions::cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Subscriptions
的用法示例。
在下文中一共展示了WC_Subscriptions::cache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Set up the class, including it's hooks & filters, when the file is loaded.
*
* @since 1.0
**/
public static function init()
{
// Register our custom subscription order type after WC_Post_types::register_post_types()
add_action('init', __CLASS__ . '::register_order_types', 6);
// Register our custom subscription order statuses before WC_Post_types::register_post_status()
add_action('init', __CLASS__ . '::register_post_status', 9);
add_action('admin_init', __CLASS__ . '::maybe_activate_woocommerce_subscriptions');
register_deactivation_hook(__FILE__, __CLASS__ . '::deactivate_woocommerce_subscriptions');
// Override the WC default "Add to Cart" text to "Sign Up Now" (in various places/templates)
add_filter('woocommerce_order_button_text', __CLASS__ . '::order_button_text');
add_action('woocommerce_subscription_add_to_cart', __CLASS__ . '::subscription_add_to_cart', 30);
add_action('wcopc_subscription_add_to_cart', __CLASS__ . '::wcopc_subscription_add_to_cart');
// One Page Checkout compatibility
// Ensure a subscription is never in the cart with products
add_filter('woocommerce_add_to_cart_validation', __CLASS__ . '::maybe_empty_cart', 10, 3);
// Enqueue front-end styles
add_filter('woocommerce_enqueue_styles', __CLASS__ . '::enqueue_styles', 10, 1);
// Display Subscriptions on a User's account page
add_action('woocommerce_before_my_account', __CLASS__ . '::get_my_subscriptions_template');
// Load translation files
add_action('plugins_loaded', __CLASS__ . '::load_plugin_textdomain');
// Load dependent files
add_action('plugins_loaded', __CLASS__ . '::load_dependant_classes');
// Attach hooks which depend on WooCommerce constants
add_action('plugins_loaded', __CLASS__ . '::attach_dependant_hooks');
// WooCommerce 2.0 Notice
add_action('admin_notices', __CLASS__ . '::woocommerce_dependancy_notice');
// Staging site or site migration notice
add_action('admin_notices', __CLASS__ . '::woocommerce_site_change_notice');
// Add the "Settings | Documentation" links on the Plugins administration screen
add_filter('plugin_action_links_' . plugin_basename(__FILE__), __CLASS__ . '::action_links');
add_filter('action_scheduler_queue_runner_batch_size', __CLASS__ . '::action_scheduler_multisite_batch_size');
add_action('in_plugin_update_message-' . plugin_basename(__FILE__), __CLASS__ . '::update_notice', 10, 2);
$scheduler_class = apply_filters('woocommerce_subscriptions_scheduler', 'WCS_Action_Scheduler');
self::$cache = WCS_Cache_Manager::get_instance();
self::$scheduler = new $scheduler_class();
}