PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 2.6.4
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v2.6.4
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
← All changes | inc/init.php +73 -21 2.1.22.6.4 View file →
@@ -29,15 +29,18 @@
29 29 add_action('enqueue_block_editor_assets', array($this,'blockspare_create_block'));
30 30 add_action('wp_enqueue_scripts', array($this,'blockspare_load_scripts'));
31 31 add_action('plugins_loaded', array($this,'blockspare_blocks_loader'));
32 32 add_action( 'rest_api_init', array($this,'blockspare_blocks_register_api_endpoints' ));
33 +
34 +
33 35 }
34 36
35 37 function blockspare_blocks_block_assets(){
36 - wp_enqueue_style(
37 - 'blockspare-blocks-fontawesome-front',
38 + wp_register_style(
39 + 'fontawesome',
38 40 plugins_url('assets/fontawesome/css/all.css', dirname(__FILE__)),
39 41 array()
42 +
40 43 );
41 44 // Load the compiled styles.
42 45 wp_enqueue_style(
43 46 'blockspare-frontend-block-style-css',
@@ -43,28 +46,48 @@
43 46 'blockspare-frontend-block-style-css',
44 47 plugins_url('dist/style-blocks.css', dirname(__FILE__)),
45 48 array()
46 49 );
47 -
48 -
49 - wp_enqueue_style('slick-css', BLOCKSPARE_PLUGIN_URL . 'assets/slick/css/slick.css', array(), '', 'all');
50 +
51 + wp_register_style('slick', BLOCKSPARE_PLUGIN_URL . 'assets/slick/css/slick.css', array(), '', 'all');
52 + if (is_admin()){
53 + wp_enqueue_style('slick');
54 + }
55 +
56 + include(BLOCKSPARE_PLUGIN_DIR . '/admin/notice-upgrade.php');
50 57 }
51 58
52 59 function blockspare_load_scripts(){
53 - $min = (SCRIPT_DEBUG == true) ? '' : '.min';
54 - wp_enqueue_script('slick-js', BLOCKSPARE_PLUGIN_URL . 'assets/slick/js/slick.js', array('jquery'), '', true);
55 - wp_register_script('countup', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/jquery.counterup' . $min . '.js', array('waypoint'), true);
56 - wp_enqueue_script('waypoint', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/waypoints.min.js', array('jquery'), '', true);
57 - wp_enqueue_script('jquery-masonry');
58 - wp_enqueue_script('blockspare-animation', BLOCKSPARE_PLUGIN_URL . 'dist/block_animation.js', array(), '', true);
59 - wp_enqueue_script('blockspare-script', BLOCKSPARE_PLUGIN_URL . 'dist/block_frontend.js', array('jquery', 'waypoint', 'countup'), '', true);
60 - wp_enqueue_script('blockspare-tabs', BLOCKSPARE_PLUGIN_URL . 'dist/block_tabs.js', array('jquery'), '', true);
61 - wp_enqueue_script('blockspare-pagination-js', BLOCKSPARE_PLUGIN_URL . 'dist/block_pagination.js', array(), '', true);
60 + if(has_blocks()){
61 +
62 + wp_enqueue_style('fontawesome');
63 + $min = (SCRIPT_DEBUG == true) ? '' : '.min';
64 + wp_register_script('slick', BLOCKSPARE_PLUGIN_URL . 'assets/slick/js/slick.js', array('jquery'), '', true);
65 + if(has_block('blockspare/blockspare-carousel' )|| has_block('blockspare/blockspare-slider' ) || has_block('blockspare/latest-posts-block-carousel-grid') || has_block('blockspare/blockspare-posts-block-slider')){
66 + wp_enqueue_script('slick');
67 + wp_enqueue_style('slick');
68 +
69 + }
70 +
71 + wp_register_script('countup', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/jquery.counterup' . $min . '.js', array('waypoint'), true);
72 + wp_enqueue_script('waypoint', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/waypoints.min.js', array('jquery'), '', true);
73 +
74 + if(has_block('blockspare/blockspare-masonry')){
75 + wp_enqueue_script('jquery-masonry');
76 + }
77 + wp_enqueue_script('blockspare-animation', BLOCKSPARE_PLUGIN_URL . 'dist/block_animation.js', array(), '', true);
78 + wp_enqueue_script('blockspare-script', BLOCKSPARE_PLUGIN_URL . 'dist/block_frontend.js', array('jquery', 'waypoint', 'countup'), '', true);
79 + if(has_block('blockspare/blockspare-tabs')){
80 + wp_enqueue_script('blockspare-tabs', BLOCKSPARE_PLUGIN_URL . 'dist/block_tabs.js', array('jquery'), '', true);
81 + }
82 + wp_register_script('blockspare-pagination-js', BLOCKSPARE_PLUGIN_URL . 'dist/block_pagination.js', array(), '', true);
83 + wp_localize_script('blockspare-pagination-js', 'blocsparePagination',array(
84 + 'ajaxurl' => admin_url( 'admin-ajax.php' ),
85 + 'nonce'=>wp_create_nonce('blockspare-load-more-nonce')
86 + ));
87 + }
62 88
63 - wp_localize_script('blockspare-pagination-js', 'blocsparePagination',array(
64 - 'ajaxurl' => admin_url( 'admin-ajax.php' ),
65 - 'nonce'=>wp_create_nonce('blockspare-load-more-nonce')
66 - ));
89 +
67 90 }
68 91
69 92 function blockspare_create_block(){
70 93
@@ -96,8 +119,9 @@
96 119 // Enqueue the script in the footer.
97 120 );
98 121
99 122 if (is_admin()) :
123 + wp_enqueue_style('fontawesome');
100 124 wp_enqueue_style(
101 125 'blockspare-block-edit-style',
102 126 BLOCKSPARE_PLUGIN_URL . 'dist/blocks.css',
103 127 array('wp-edit-blocks')
@@ -119,9 +143,9 @@
119 143 'value' => $type->term_id,
120 144 );
121 145 }
122 146
123 -
147 + $date = wp_kses_post(date_i18n(get_option('date_format')));
124 148 wp_localize_script(
125 149 'blockspare-blocks-block-js',
126 150 'blockspare_globals',
127 151 array(
@@ -134,8 +158,10 @@
134 158 'postQueryEndpoint'=>'aft/v1/post-query',
135 159 'config' => '',
136 160 'configuration' => '',
137 161 'settings' => '',
162 + 'bs_date'=>$date,
163 + "imagePath"=> "https://templatespare.com/wp-content/uploads/blockspare/blocks/"
138 164 )
139 165 );
140 166 }
141 167
@@ -159,8 +185,10 @@
159 185
160 186 return apply_filters( 'aft_blocks_post_types', $output );
161 187 }
162 188
189 +
190 +
163 191 function aft_get_taxonomies() {
164 192 $post_types = $this->aft_get_post_types();
165 193 $output = array();
166 194 foreach ( $post_types as $key => $post_type ) {
@@ -189,22 +217,42 @@
189 217 return apply_filters( 'aft_blocks_taxonomies', $output );
190 218 }
191 219
192 220 function blockspare_blocks_loader(){
221 +
222 + if ( PHP_VERSION_ID >= 50600 ) {
223 + require_once BLOCKSPARE_PLUGIN_DIR .'inc/layout/class-image-importer.php';
224 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/functions.php';
225 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/registry.php';
226 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/components.php';
227 +
228 + /**
229 + * REST API Endpoints for Layouts.
230 + */
231 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/endpoints.php';
232 +
233 + /**
234 + * Import Pattern
235 + */
236 +
237 + //require_once BLOCKSPARE_PLUGIN_DIR . 'inc/pattern/pattern.php';
238 + }
193 239
194 240 //Load Gutenberg Block php Files
241 + include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/date-time/index.php');
195 242 include(BLOCKSPARE_PLUGIN_DIR . '/inc/other-block/social-sharing/index.php');
196 243 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-grid/index.php');
197 244 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-list/index.php');
198 245
199 246 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/index.php');
247 + include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/post-content.php');
200 248
201 249
202 250 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-carousel-grid/index.php');
203 251 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-slider/index.php');
204 252
205 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/block-banner/banner-1/index.php');
206 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/block-banner/banner-2/index.php');
253 + include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-1/index.php');
254 + include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-2/index.php');
207 255 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/ajax-pagination.php');
208 256 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-post-rest-api.php');
209 257 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-backend.php');
210 258 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-frontend.php');
@@ -211,8 +259,12 @@
211 259 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/tax-category.php');
212 260 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-bs-post.php');
213 261 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-config.php');
214 262 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-style.php');
263 + include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/search/index.php');
264 + include(BLOCKSPARE_PLUGIN_DIR . 'inc/latest-post-block/posts-flash/index.php');
265 + include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/popular-tags/index.php');
266 + include(BLOCKSPARE_PLUGIN_DIR . 'inc/page-templates/module.php');
215 267 }
216 268
217 269 function blockspare_blocks_register_api_endpoints(){
218 270