* The 'select_subscription' flag is picked up by JavaScript to set the value of the product type to "Subscription". * * @since 1.0 */ public static function add_subscription_url($show_pointers = true) { $add_subscription_url = admin_url('post-new.php?post_type=product&select_subscription=true'); if ($show_pointers == true) { $add_subscription_url = add_query_arg('subscription_pointers', 'true', $add_subscription_url); } return $add_subscription_url; } /** * Searches through the list of active plugins to find WooCommerce. Just in case * WooCommerce resides in a folder other than /woocommerce/ * * @since 1.0 */ public static function get_woocommerce_plugin_dir_file() { foreach (get_option('active_plugins', array()) as $plugin) { if (substr($plugin, strlen('/woocommerce.php') * -1) === '/woocommerce.php') { $woocommerce_plugin_file = $plugin; break; } } return $woocommerce_plugin_file; } } WC_Subscriptions_Admin::init();