Changeset 3002068
- Timestamp:
- 11/27/2023 09:27:54 AM (2 years ago)
- File:
-
- 1 edited
-
boomerang/trunk/boomerang.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boomerang/trunk/boomerang.php
r2997662 r3002068 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.0 9 * Author: B en Roberts9 * Author: Bouncingsprout Studio 10 10 * License: GPL v2 or later 11 11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 * Domain Path: /languages 14 14 * Version: 1.0.0 15 * 16 * @fs_premium_only /admin/inc/classes/class-boomerang-customizer.php, /inc/boomerang-pro-filters.php 15 17 */ 16 18 … … 21 23 } 22 24 23 if ( ! function_exists( 'boo_fs' ) ) { 24 // Create a helper function for easy SDK access. 25 function boo_fs() { 26 global $boo_fs; 25 if ( function_exists( 'boo_fs' ) ) { 26 boo_fs()->set_basename( true, __FILE__ ); 27 } else { 28 // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK. 29 if ( ! function_exists( 'boo_fs' ) ) { 30 // Create a helper function for easy SDK access. 31 function boo_fs() { 32 global $boo_fs; 27 33 28 if ( ! isset( $boo_fs ) ) {29 // Include Freemius SDK.30 require_once dirname( __FILE__ ) . '/freemius/start.php';34 if ( ! isset( $boo_fs ) ) { 35 // Include Freemius SDK. 36 require_once dirname( __FILE__ ) . '/freemius/start.php'; 31 37 32 $boo_fs = fs_dynamic_init( 33 array( 34 'id' => '14215', 35 'slug' => 'boomerang', 36 'type' => 'plugin', 37 'public_key' => 'pk_227b2104cb4396d666b43182e1861', 38 'is_premium' => false, 39 'has_addons' => false, 40 'has_paid_plans' => false, 41 'menu' => array( 42 'slug' => 'edit.php?post_type=boomerang', 38 $boo_fs = fs_dynamic_init( array( 39 'id' => '14215', 40 'slug' => 'boomerang', 41 'premium_slug' => 'boomerang-pro', 42 'type' => 'plugin', 43 'public_key' => 'pk_227b2104cb4396d666b43182e1861', 44 'is_premium' => true, 45 'is_premium_only' => true, 46 'has_addons' => false, 47 'has_paid_plans' => true, 48 'menu' => array( 49 'slug' => 'edit.php?post_type=boomerang', 50 'support' => false, 43 51 ), 44 ) 45 ); 52 ) ); 53 } 54 55 return $boo_fs; 46 56 } 47 57 48 return $boo_fs; 58 // Init Freemius. 59 boo_fs(); 60 // Signal that SDK was initiated. 61 do_action( 'boo_fs_loaded' ); 49 62 } 50 63 51 // Init Freemius. 52 boo_fs(); 53 // Signal that SDK was initiated. 54 do_action( 'boo_fs_loaded' ); 55 } 64 define( 'BOOMERANG_PATH', plugin_dir_path( __FILE__ ) ); 65 define( 'BOOMERANG_URL', plugin_dir_url( __FILE__ ) ); 66 define( 'BOOMERANG_BASENAME', plugin_basename( __FILE__ ) ); 67 define( 'BOOMERANG_VERSION', '1.0.0' ); 56 68 57 define( 'BOOMERANG_PATH', plugin_dir_path( __FILE__ ) ); 58 define( 'BOOMERANG_URL', plugin_dir_url( __FILE__ ) ); 59 define( 'BOOMERANG_BASENAME', plugin_basename( __FILE__ ) ); 60 define( 'BOOMERANG_VERSION', boomerang_get_version() ); 69 /** 70 * Get the plugin's version number. 71 * 72 * @deprecated 73 * 74 * @return mixed 75 */ 76 function boomerang_get_version() { 77 if ( ! function_exists( 'get_plugin_data' ) ) { 78 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 79 } 61 80 62 /** 63 * Get the plugin's version number. 64 * 65 * @return mixed 66 */ 67 function boomerang_get_version() { 68 if ( ! function_exists( 'get_plugin_data' ) ) { 69 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 81 $plugin_data = get_plugin_data( __FILE__ ); 82 83 return $plugin_data['Version']; 70 84 } 71 85 72 $plugin_data = get_plugin_data( __FILE__ ); 86 /** 87 * Start the engines, Captain... 88 */ 89 function boomerang_init() { 90 require_once BOOMERANG_PATH . 'vendor/codestar-framework/codestar-framework.php'; 91 require BOOMERANG_PATH . '/inc/classes/class-boomerang.php'; 92 require BOOMERANG_PATH . '/inc/boomerang-global-functions.php'; 73 93 74 return $plugin_data['Version']; 75 } 76 77 /** 78 * Start the engines, Captain... 79 */ 80 function boomerang_init() { 81 require_once BOOMERANG_PATH . 'vendor/codestar-framework/codestar-framework.php'; 82 require BOOMERANG_PATH . '/inc/classes/class-boomerang.php'; 83 require BOOMERANG_PATH . '/inc/boomerang-global-functions.php'; 84 85 $boomerang = new Boomerang(); 86 } 87 boomerang_init(); 88 89 /** 90 * Tasks to run on plugin activation. 91 */ 92 function boomerang_activate() { 93 94 if ( ! class_exists( 'Boomerang_CPT_Helper' ) ) { 95 require_once BOOMERANG_PATH . '/inc/classes/class-boomerang-cpt-helper.php'; 94 $boomerang = new Boomerang(); 96 95 } 97 96 98 $cpt = new Boomerang_CPT_Helper(); 99 $cpt->register_post_types(); 97 boomerang_init(); 100 98 101 flush_rewrite_rules(); 99 /** 100 * Tasks to run on plugin activation. 101 */ 102 function boomerang_activate() { 103 if ( ! class_exists( 'Boomerang_CPT_Helper' ) ) { 104 require_once BOOMERANG_PATH . '/inc/classes/class-boomerang-cpt-helper.php'; 105 } 106 107 $cpt = new Boomerang_CPT_Helper(); 108 $cpt->register_post_types(); 109 110 flush_rewrite_rules(); 111 } 112 113 register_activation_hook( __FILE__, __NAMESPACE__ . '\boomerang_activate' ); 102 114 } 103 register_activation_hook( __FILE__, __NAMESPACE__ . '\boomerang_activate' );
Note: See TracChangeset
for help on using the changeset viewer.