PluginProbe
Boxzilla – WordPress Popup Builder / 3.2
Boxzilla – WordPress Popup Builder v3.2
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 +29 -45 3.03.2 View file →
@@ -9,59 +9,43 @@
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 - );
41 17
42 - register_post_type( 'boxzilla-box', $args );
43 -});
18 +// Rest of bootstrapping runs at plugins_loaded:90
19 +add_action( 'plugins_loaded', function() use( $boxzilla ) {
44 20
45 -if( ! is_admin() ) {
21 + // load default filters
22 + require __DIR__ . '/src/default-filters.php';
23 + require __DIR__ . '/src/default-actions.php';
46 24
47 - // PUBLIC
48 - add_action( 'template_redirect', function() use( $boxzilla ) {
49 - $boxzilla['box_loader']->init();
25 + $bootstrapper = $boxzilla->bootstrapper;
26 +
27 + $bootstrapper->admin(function() use( $boxzilla ){
28 + $boxzilla['admin']->init();
29 +
30 + if( count( $boxzilla->plugins ) > 0 ) {
31 + $boxzilla['license_manager']->hook();
32 + $boxzilla['update_manager']->hook();
33 + }
50 34 });
51 35
52 -} else {
36 + $bootstrapper->ajax(function() use( $boxzilla ) {
37 + $boxzilla['filter.autocomplete']->add_hooks();
38 + });
53 39
54 - // ADMIN (and AJAX)
55 - $provider = new Licensing\LicenseServiceProvider();
56 - $provider->register( $boxzilla );
40 + $bootstrapper->front(function() use( $boxzilla ) {
41 + add_action( 'template_redirect', function() use( $boxzilla ) {
42 + $boxzilla['box_loader']->init();
43 + });
44 + });
57 45
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 -}
46 + $bootstrapper->cron(function() use( $boxzilla ) {
47 + $boxzilla['license_poller']->hook();
48 + });
67 49
50 + $bootstrapper->run();
51 +}, 90 );