PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 2.7.0
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v2.7.0
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 +67 -20 2.5.32.7.0 View file →
@@ -34,12 +34,13 @@
34 34
35 35 }
36 36
37 37 function blockspare_blocks_block_assets(){
38 - wp_enqueue_style(
39 - 'blockspare-blocks-fontawesome-front',
38 + wp_register_style(
39 + 'fontawesome',
40 40 plugins_url('assets/fontawesome/css/all.css', dirname(__FILE__)),
41 41 array()
42 +
42 43 );
43 44 // Load the compiled styles.
44 45 wp_enqueue_style(
45 46 'blockspare-frontend-block-style-css',
@@ -45,28 +46,48 @@
45 46 'blockspare-frontend-block-style-css',
46 47 plugins_url('dist/style-blocks.css', dirname(__FILE__)),
47 48 array()
48 49 );
49 -
50 -
51 - 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');
52 57 }
53 58
54 59 function blockspare_load_scripts(){
55 - $min = (SCRIPT_DEBUG == true) ? '' : '.min';
56 - wp_enqueue_script('slick-js', BLOCKSPARE_PLUGIN_URL . 'assets/slick/js/slick.js', array('jquery'), '', true);
57 - wp_register_script('countup', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/jquery.counterup' . $min . '.js', array('waypoint'), true);
58 - wp_enqueue_script('waypoint', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/waypoints.min.js', array('jquery'), '', true);
59 - wp_enqueue_script('jquery-masonry');
60 - wp_enqueue_script('blockspare-animation', BLOCKSPARE_PLUGIN_URL . 'dist/block_animation.js', array(), '', true);
61 - wp_enqueue_script('blockspare-script', BLOCKSPARE_PLUGIN_URL . 'dist/block_frontend.js', array('jquery', 'waypoint', 'countup'), '', true);
62 - wp_enqueue_script('blockspare-tabs', BLOCKSPARE_PLUGIN_URL . 'dist/block_tabs.js', array('jquery'), '', true);
63 - 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 + }
64 88
65 - wp_localize_script('blockspare-pagination-js', 'blocsparePagination',array(
66 - 'ajaxurl' => admin_url( 'admin-ajax.php' ),
67 - 'nonce'=>wp_create_nonce('blockspare-load-more-nonce')
68 - ));
89 +
69 90 }
70 91
71 92 function blockspare_create_block(){
72 93
@@ -98,8 +119,9 @@
98 119 // Enqueue the script in the footer.
99 120 );
100 121
101 122 if (is_admin()) :
123 + wp_enqueue_style('fontawesome');
102 124 wp_enqueue_style(
103 125 'blockspare-block-edit-style',
104 126 BLOCKSPARE_PLUGIN_URL . 'dist/blocks.css',
105 127 array('wp-edit-blocks')
@@ -108,9 +130,9 @@
108 130
109 131
110 132 $blockspare_priview_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img.jpg';
111 133 $blockspare_food_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img-square.jpg';
112 -
134 + $blockspare_dashboard_logo = BLOCKSPARE_PLUGIN_URL . 'assets/images/blockspare-logo.png';
113 135 $taxonomies = get_categories();
114 136 $txnm = array();
115 137
116 138 foreach( $taxonomies as $type ) {
@@ -121,9 +143,9 @@
121 143 'value' => $type->term_id,
122 144 );
123 145 }
124 146
125 -
147 + $date = wp_kses_post(date_i18n(get_option('date_format')));
126 148 wp_localize_script(
127 149 'blockspare-blocks-block-js',
128 150 'blockspare_globals',
129 151 array(
@@ -129,9 +151,12 @@
129 151 array(
130 152 'srcUrl' => untrailingslashit(plugins_url('/', BLOCKSPARE_BASE_DIR . '/dist/')),
131 153 'rest_url' => esc_url(rest_url()),
132 154 'img' => $blockspare_priview_img_url,
155 + 'homeUrl'=>home_url(),
156 + 'blogUrl'=>get_site_url(),
133 157 'menu_img_url' => $blockspare_food_img_url,
158 + 'logo'=>$blockspare_dashboard_logo,
134 159 'postTypes' => $this->aft_get_post_types(),
135 160 'taxonomies' => $this->aft_get_taxonomies(),
136 161 'postQueryEndpoint'=>'aft/v1/post-query',
137 162 'config' => '',
@@ -136,8 +161,10 @@
136 161 'postQueryEndpoint'=>'aft/v1/post-query',
137 162 'config' => '',
138 163 'configuration' => '',
139 164 'settings' => '',
165 + 'bs_date'=>$date,
166 + "imagePath"=> "https://templatespare.com/wp-content/uploads/blockspare/blocks/"
140 167 )
141 168 );
142 169 }
143 170
@@ -193,8 +220,26 @@
193 220 return apply_filters( 'aft_blocks_taxonomies', $output );
194 221 }
195 222
196 223 function blockspare_blocks_loader(){
224 +
225 + if ( PHP_VERSION_ID >= 50600 ) {
226 + require_once BLOCKSPARE_PLUGIN_DIR .'inc/layout/class-image-importer.php';
227 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/functions.php';
228 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/registry.php';
229 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/components.php';
230 +
231 + /**
232 + * REST API Endpoints for Layouts.
233 + */
234 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/endpoints.php';
235 +
236 + /**
237 + * Import Pattern
238 + */
239 +
240 + //require_once BLOCKSPARE_PLUGIN_DIR . 'inc/pattern/pattern.php';
241 + }
197 242
198 243 //Load Gutenberg Block php Files
199 244 include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/date-time/index.php');
200 245 include(BLOCKSPARE_PLUGIN_DIR . '/inc/other-block/social-sharing/index.php');
@@ -201,8 +246,9 @@
201 246 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-grid/index.php');
202 247 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-list/index.php');
203 248
204 249 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/index.php');
250 + include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/post-content.php');
205 251
206 252
207 253 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-carousel-grid/index.php');
208 254 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-slider/index.php');
@@ -208,8 +254,9 @@
208 254 include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-slider/index.php');
209 255
210 256 include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-1/index.php');
211 257 include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-2/index.php');
258 + include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-9/index.php');
212 259 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/ajax-pagination.php');
213 260 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-post-rest-api.php');
214 261 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-backend.php');
215 262 include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-frontend.php');