PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.18
Boxzilla – WordPress Popup Builder v3.2.18
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
← All changes | bootstrap.php +38 -48 3.03.2.18 View file →
@@ -9,59 +9,49 @@
9 9
10 10 // register services
11 11 $provider = new BoxzillaServiceProvider();
12 12 $provider->register( $boxzilla );
13 +$provider = new Licensing\LicenseServiceProvider();
14 +$provider->register( $boxzilla );
13 15
14 -// load default filters
15 -require __DIR__ . '/src/default-filters.php';
16 16
17 -add_action( 'init', function() use( $boxzilla ){
18 - // Register custom post type
19 - $args = array(
20 - 'public' => false,
21 - 'labels' => array(
22 - 'name' => __( 'Boxzilla', 'boxzilla' ),
23 - 'singular_name' => __( 'Box', 'boxzilla' ),
24 - 'add_new' => __( 'Add New', 'boxzilla' ),
25 - 'add_new_item' => __( 'Add New Box', 'boxzilla' ),
26 - 'edit_item' => __( 'Edit Box', 'boxzilla' ),
27 - 'new_item' => __( 'New Box', 'boxzilla' ),
28 - 'all_items' => __( 'All Boxes', 'boxzilla' ),
29 - 'view_item' => __( 'View Box', 'boxzilla' ),
30 - 'search_items' => __( 'Search Boxes', 'boxzilla' ),
31 - 'not_found' => __( 'No Boxes found', 'boxzilla' ),
32 - 'not_found_in_trash' => __( 'No Boxes found in Trash', 'boxzilla' ),
33 - 'parent_item_colon' => '',
34 - 'menu_name' => __( 'Boxzilla', 'boxzilla' )
35 - ),
36 - 'show_ui' => true,
37 - 'menu_position' => '108.1337133',
38 - 'menu_icon' => $boxzilla->plugin->url( '/assets/img/menu-icon.png' ),
39 - 'query_var' => false
40 - );
17 +// Rest of bootstrapping runs at plugins_loaded:90
18 +add_action(
19 + 'plugins_loaded',
20 + function() use ( $boxzilla ) {
41 21
42 - register_post_type( 'boxzilla-box', $args );
43 -});
22 + // load default filters
23 + require __DIR__ . '/src/default-filters.php';
24 + require __DIR__ . '/src/default-actions.php';
44 25
45 -if( ! is_admin() ) {
26 + if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
27 + $boxzilla['filter.autocomplete']->init();
28 + $boxzilla['admin.menu']->init();
29 + } elseif ( defined( 'DOING_CRON' ) && DOING_CRON ) {
30 + $boxzilla['license_poller']->init();
31 + } elseif ( is_admin() ) {
32 + $boxzilla['admin']->init();
33 + $boxzilla['admin.menu']->init();
34 + } else {
35 + add_action(
36 + 'template_redirect',
37 + function() use ( $boxzilla ) {
38 + $boxzilla['box_loader']->init();
39 + }
40 + );
41 + }
46 42
47 - // PUBLIC
48 - add_action( 'template_redirect', function() use( $boxzilla ) {
49 - $boxzilla['box_loader']->init();
50 - });
43 + // license manager
44 + if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
45 + $boxzilla['license_manager']->init();
51 46
52 -} else {
47 + if ( count( $boxzilla->plugins ) > 0 ) {
48 + $boxzilla['update_manager']->init();
49 + }
50 + }
53 51
54 - // ADMIN (and AJAX)
55 - $provider = new Licensing\LicenseServiceProvider();
56 - $provider->register( $boxzilla );
57 -
58 - if( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
59 - add_action('init', function() use( $boxzilla ) {
60 - $boxzilla['admin']->init();
61 - });
62 - } else {
63 - $boxzilla['filter.autocomplete']->add_hooks();
64 - }
65 -
66 -}
67 -
52 + // for legacy reasons: Boxzilla Theme Pack & Boxzilla WooCommerce used this
53 + // we will be removing this in future versions
54 + $boxzilla['bootstrapper']->run();
55 + },
56 + 90
57 +);