当前位置: 首页>>代码示例>>PHP>>正文


PHP WC_Subscriptions::scheduler方法代码示例

本文整理汇总了PHP中WC_Subscriptions::scheduler方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions::scheduler方法的具体用法?PHP WC_Subscriptions::scheduler怎么用?PHP WC_Subscriptions::scheduler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WC_Subscriptions的用法示例。


在下文中一共展示了WC_Subscriptions::scheduler方法的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();
 }
开发者ID:slavic18,项目名称:cats,代码行数:42,代码来源:woocommerce-subscriptions.php


注:本文中的WC_Subscriptions::scheduler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。