Changeset 3418248
- Timestamp:
- 12/12/2025 12:42:27 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
simple-storewide-sale-for-woocommerce/tags/1.0.0/simple-storewide-sale-for-woocommerce.php
r3330527 r3418248 19 19 * Text Domain: simple-storewide-sale-for-woocommerce 20 20 * Domain Path: /languages 21 * Requires Plugins: woocommerce21 * Requires Plugins: WooCommerce 22 22 * 23 23 * WC requires at least: 4.0 … … 25 25 */ 26 26 // If this file is called directly, abort. 27 if ( ! defined( 'ABSPATH' ) ) {28 die;27 if ( ! defined( 'ABSPATH' ) ) { 28 die; 29 29 } 30 30 if ( function_exists( 'sssfw' ) ) { 31 sssfw()->set_basename( false, __FILE__ );31 sssfw()->set_basename( false, __FILE__ ); 32 32 } else { 33 /** 34 * Create a helper function for easy SDK access. 35 */ 36 function sssfw_fs() { 37 global $sssfw_fs; 38 if ( !isset( $sssfw_fs ) ) { 39 // Include Freemius SDK. 40 require_once __DIR__ . '/vendor/freemius/start.php'; 41 $sssfw_fs = fs_dynamic_init( array( 42 'id' => '18506', 43 'slug' => 'simple-storewide-sale-for-woocommerce', 44 'type' => 'plugin', 45 'public_key' => 'pk_a4d9a444a269fb51ecfbcce526a4f', 46 'is_premium' => false, 47 'is_org_compliant' => true, 48 'premium_suffix' => 'Professional', 49 'has_addons' => false, 50 'has_paid_plans' => true, 51 'menu' => array( 52 'slug' => 'simple-storewide-sale-for-woocommerce', 53 'override_exact' => true, 54 'support' => true, 55 'parent' => array( 56 'slug' => 'options-general.php', 57 ), 58 ), 59 'is_live' => true, 60 ) ); 61 } 62 return $sssfw_fs; 63 } 33 /** 34 * Create a helper function for easy SDK access. 35 */ 36 function sssfw_fs() { 37 global $sssfw_fs; 38 if ( ! isset( $sssfw_fs ) ) { 39 // Include Freemius SDK. 40 require_once __DIR__ . '/vendor/freemius/start.php'; 41 $sssfw_fs = fs_dynamic_init( 42 array( 43 'id' => '18506', 44 'slug' => 'simple-storewide-sale-for-woocommerce', 45 'type' => 'plugin', 46 'public_key' => 'pk_a4d9a444a269fb51ecfbcce526a4f', 47 'is_premium' => false, 48 'is_org_compliant' => true, 49 'premium_suffix' => 'Professional', 50 'has_addons' => false, 51 'has_paid_plans' => true, 52 'menu' => array( 53 'slug' => 'simple-storewide-sale-for-woocommerce', 54 'override_exact' => true, 55 'support' => true, 56 'parent' => array( 57 'slug' => 'options-general.php', 58 ), 59 ), 60 'is_live' => true, 61 ) 62 ); 63 } 64 return $sssfw_fs; 65 } 64 66 65 // Init Freemius.66 sssfw_fs();67 // Signal that SDK was initiated.68 do_action( 'sssfw_fs_loaded' );69 /**70 * Sssfw_fs_settings_url71 *72 * @return string73 */74 function sssfw_fs_settings_url() {75 return admin_url( 'admin.php?page=wc-settings&tab=simple_storewide_sale' );76 }67 // Init Freemius. 68 sssfw_fs(); 69 // Signal that SDK was initiated. 70 do_action( 'sssfw_fs_loaded' ); 71 /** 72 * Sssfw_fs_settings_url 73 * 74 * @return string 75 */ 76 function sssfw_fs_settings_url() { 77 return admin_url( 'admin.php?page=wc-settings&tab=simple_storewide_sale' ); 78 } 77 79 78 sssfw_fs()->add_filter( 'connect_url', 'sssfw_fs_settings_url' );79 sssfw_fs()->add_filter( 'after_skip_url', 'sssfw_fs_settings_url' );80 sssfw_fs()->add_filter( 'after_connect_url', 'sssfw_fs_settings_url' );81 sssfw_fs()->add_filter( 'after_pending_connect_url', 'sssfw_fs_settings_url' );80 sssfw_fs()->add_filter( 'connect_url', 'sssfw_fs_settings_url' ); 81 sssfw_fs()->add_filter( 'after_skip_url', 'sssfw_fs_settings_url' ); 82 sssfw_fs()->add_filter( 'after_connect_url', 'sssfw_fs_settings_url' ); 83 sssfw_fs()->add_filter( 'after_pending_connect_url', 'sssfw_fs_settings_url' ); 82 84 } 83 85 /** … … 86 88 */ 87 89 require plugin_dir_path( __FILE__ ) . 'includes/class-simple-storewide-sale-for-woocommerce.php'; 88 add_action( 'before_woocommerce_init', function () { 89 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 90 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 91 } 92 } ); 90 add_action( 91 'before_woocommerce_init', 92 function () { 93 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 94 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 95 } 96 } 97 ); 93 98 /** 94 99 * Begins execution of the plugin. … … 101 106 */ 102 107 function run_simple_storewide_sale_for_woocommerce() { 103 global $sssfw;104 $sssfw = new Simple_Storewide_Sale_For_Woocommerce();105 $sssfw->run();108 global $sssfw; 109 $sssfw = new Simple_Storewide_Sale_For_Woocommerce(); 110 $sssfw->run(); 106 111 } 107 112 108 113 add_action( 'woocommerce_init', 'run_simple_storewide_sale_for_woocommerce' ); 109 add_action( 'before_woocommerce_init', function () { 110 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 111 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 112 } 113 } ); 114 add_action( 115 'before_woocommerce_init', 116 function () { 117 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 118 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 119 } 120 } 121 );
Note: See TracChangeset
for help on using the changeset viewer.