PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 3.3.3
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v3.3.3
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 +367 -215 2.5.03.3.3 View file →
@@ -1,239 +1,391 @@
1 1 <?php
2 -
3 - //Exit if directly acess
4 - defined('ABSPATH') or die('No script kiddies please!');
2 +//Exit if directly acess
3 +defined('ABSPATH') or die('No script kiddies please!');
5 4
6 - if(!class_exists('BlockspareInit')){
7 - class BlockspareInit{
8 - /**
9 - * Member Variable
10 - *
11 - * @var instance
12 - */
13 - private static $instance;
5 +if (!class_exists('BlockspareInit')) {
6 + class BlockspareInit
7 + {
8 + /**
9 + * Member Variable
10 + *
11 + * @var instance
12 + */
13 + private static $instance;
14 14
15 - /**
16 - * Initiator
17 - */
18 - public static function get_instance()
19 - {
20 - if (!isset(self::$instance))
21 - {
22 - self::$instance = new self();
23 - }
24 - return self::$instance;
15 + /**
16 + * Initiator
17 + */
18 + public static function get_instance()
19 + {
20 + if (!isset(self::$instance)) {
21 + self::$instance = new self();
22 + }
23 + return self::$instance;
24 + }
25 + public function __construct()
26 + {
27 + add_action('init', array($this, 'blockspare_blocks_block_assets'));
28 + add_action('enqueue_block_editor_assets', array($this, 'blockspare_create_block'));
29 + if (version_compare(get_bloginfo('version'), '5.8', '<')) {
30 + add_action('wp_enqueue_scripts', array($this, 'blockspare_load_scripts'));
31 + } else {
32 + add_action('enqueue_block_assets', array($this, 'blockspare_load_scripts'), 1);
33 + }
34 + add_action('plugins_loaded', array($this, 'blockspare_blocks_loader'));
35 + add_action('rest_api_init', array($this, 'blockspare_blocks_register_api_endpoints'));
36 + }
37 +
38 + public function blockspare_blocks_block_assets()
39 + {
40 + // wp_register_style(
41 + // 'fontawesome',
42 + // plugins_url('assets/fontawesome/css/all.css', dirname(__FILE__)),
43 + // array()
44 +
45 + // );
46 + // // Load the compiled styles.
47 + // wp_enqueue_style(
48 + // 'blockspare-frontend-block-style-css',
49 + // plugins_url('dist/style-blocks.css', dirname(__FILE__)),
50 + // array()
51 + // );
52 +
53 +
54 + // wp_register_style('slick', BLOCKSPARE_PLUGIN_URL . 'assets/slick/css/slick.css', array(), '', 'all');
55 + // if (is_admin()) {
56 + // wp_enqueue_style('slick');
57 + // }
58 +
59 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/accordion');
60 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/button');
61 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/call-to-action');
62 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/content-box');
63 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/container');
64 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/counter');
65 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/icon-set');
66 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/image-carousel');
67 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/linear-progressbar');
68 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/list');
69 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/logos');
70 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/image-masonry');
71 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/notice-bar');
72 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/price-list');
73 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/pricing-table');
74 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/social-links');
75 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/section-header');
76 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/services');
77 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/image-slider');
78 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/star-ratings');
79 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/testimonial');
80 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/user-profile');
81 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/shape-divider');
82 + register_block_type(BLOCKSPARE_PLUGIN_DIR . 'dist/blocks/empty-section');
83 +
84 + include BLOCKSPARE_PLUGIN_DIR . '/admin/notice-setup.php';
85 + include BLOCKSPARE_PLUGIN_DIR . '/admin/notice-upgrade.php';
86 + }
87 +
88 + public function blockspare_load_scripts()
89 + {
90 +
91 + wp_register_style(
92 + 'fontawesome',
93 + plugins_url('assets/fontawesome/css/all.css', dirname(__FILE__)),
94 + array()
95 +
96 + );
97 + // Load the compiled styles.
98 + wp_enqueue_style(
99 + 'blockspare-frontend-block-style-css',
100 + plugins_url('dist/style-blocks.css', dirname(__FILE__)),
101 + array()
102 + );
103 +
104 + wp_enqueue_style(
105 + 'blockspare-frontend-banner-style-css',
106 + plugins_url('dist/style-banner_group.css', dirname(__FILE__)),
107 + array()
108 + );
109 +
110 +
111 + wp_register_style('slick', BLOCKSPARE_PLUGIN_URL . 'assets/slick/css/slick.css', array(), '', 'all');
112 + if (is_admin()) {
113 + wp_enqueue_style('slick');
114 + }
115 +
116 + wp_enqueue_style('fontawesome');
117 + $min = (SCRIPT_DEBUG == true) ? '' : '.min';
118 + wp_register_script('slick', BLOCKSPARE_PLUGIN_URL . 'assets/slick/js/slick.js', array('jquery'), '', true);
119 + if (has_blocks() || 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')) {
120 + wp_enqueue_script('slick');
121 + wp_enqueue_style('slick');
122 + }
123 +
124 + wp_register_script('countup', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/jquery.counterup.min.js', array('waypoint'), true);
125 + wp_enqueue_script('waypoint', BLOCKSPARE_PLUGIN_URL . 'assets/js/countup/waypoints.min.js', array('jquery'), '', true);
126 +
127 + if (has_blocks() || has_block('blockspare/blockspare-masonry')) {
128 + wp_enqueue_script('jquery-masonry');
129 + }
130 + wp_enqueue_script('blockspare-animation', BLOCKSPARE_PLUGIN_URL . 'dist/block_animation.js', array(), '', true);
131 + wp_enqueue_script('blockspare-script', BLOCKSPARE_PLUGIN_URL . 'dist/block_frontend.js', array('jquery', 'waypoint', 'countup'), '', true);
132 + if (has_blocks() || has_block('blockspare/blockspare-tabs')) {
133 +
134 + wp_enqueue_script('blockspare-tabs', BLOCKSPARE_PLUGIN_URL . 'dist/block_tabs.js', array('jquery'), '', true);
135 + }
136 + wp_register_script('blockspare-pagination-js', BLOCKSPARE_PLUGIN_URL . 'dist/block_pagination.js', array(), '', true);
137 + wp_localize_script('blockspare-pagination-js', 'blocsparePagination', array(
138 + 'ajaxurl' => admin_url('admin-ajax.php'),
139 + 'nonce' => wp_create_nonce('blockspare-load-more-nonce'),
140 + ));
141 + }
142 +
143 + public function blockspare_create_block()
144 + {
145 +
146 + $script_dep_path = BLOCKSPARE_BASE_DIR . 'dist/blocks.asset.php';
147 + $script_info = file_exists($script_dep_path) ? include $script_dep_path : array(
148 + 'dependencies' => array(),
149 + 'version' => BLOCKSPARE_VERSION,
150 + );
151 + if (version_compare(get_bloginfo('version'), '5.8', '<')) {
152 + $script_dep = array_merge($script_info['dependencies'], array(
153 + 'wp-blocks',
154 + 'wp-i18n',
155 + 'wp-element',
156 + 'wp-components',
157 + 'wp-editor',
158 + 'wp-api-fetch',
159 + ));
160 + } else {
161 + $script_dep = $script_info['dependencies'];
162 + }
163 +
164 + wp_enqueue_script(
165 + 'blockspare-blocks-block-js', // Handle.
166 + BLOCKSPARE_PLUGIN_URL . 'dist/blocks.js',
167 + $script_dep, // Dependencies, defined above.
168 + $script_info['version'], // AFT_PRICING_TABLE_VERSION.
169 + true
170 + // Enqueue the script in the footer.
171 + );
172 +
173 + wp_enqueue_script(
174 + 'blockspare-banner-group-js', // Handle.
175 + BLOCKSPARE_PLUGIN_URL . 'dist/banner_group.js',
176 + $script_dep, // Dependencies, defined above.
177 + $script_info['version'], // AFT_PRICING_TABLE_VERSION.
178 + true
179 + // Enqueue the script in the footer.
180 + );
181 +
182 +
183 +
184 + if (is_admin()):
185 + wp_enqueue_style('fontawesome');
186 + wp_enqueue_style(
187 + 'blockspare-block-edit-style',
188 + BLOCKSPARE_PLUGIN_URL . 'dist/blocks.css',
189 + array('wp-edit-blocks')
190 + );
191 + wp_enqueue_style(
192 + 'blockspare-banner-edit-style',
193 + BLOCKSPARE_PLUGIN_URL . 'dist/banner_group.css',
194 + array('wp-edit-blocks')
195 + );
196 +
197 + wp_enqueue_script('blockspare-design-btn', BLOCKSPARE_PLUGIN_URL . 'dist/block_design_btn.js', array('blockspare-blocks-block-js'), $script_info['version'], true);
198 + wp_enqueue_script('blockspare-design', BLOCKSPARE_PLUGIN_URL . 'dist/block_design.js', array('blockspare-blocks-block-js'), $script_info['version'], true);
199 + wp_enqueue_style('blockspare-design', BLOCKSPARE_PLUGIN_URL . 'dist/block_design.css', array('blockspare-block-edit-style'));
200 + endif;
201 +
202 + $blockspare_priview_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img.jpg';
203 + $blockspare_food_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img-square.jpg';
204 + $blockspare_dashboard_logo = BLOCKSPARE_PLUGIN_URL . 'assets/images/blockspare-logo.png';
205 + $taxonomies = get_categories();
206 + $txnm = array();
207 +
208 + foreach ($taxonomies as $type) {
209 +
210 + $txnm[] = array(
211 + 'label' => $type->name,
212 + 'value' => $type->term_id,
213 + );
214 + }
215 +
216 + $date = wp_kses_post(date_i18n(get_option('date_format')));
217 + $open_design = false;
218 + if (isset($_GET['blockspare_show_intro'])) {
219 + if ($_GET['blockspare_show_intro'] == 'true') {
220 + $open_design = true;
25 221 }
26 - public function __construct()
27 - {
28 - add_action('init', array($this, 'blockspare_blocks_block_assets' ));
29 - add_action('enqueue_block_editor_assets', array($this,'blockspare_create_block'));
30 - add_action('wp_enqueue_scripts', array($this,'blockspare_load_scripts'));
31 - add_action('plugins_loaded', array($this,'blockspare_blocks_loader'));
32 - add_action( 'rest_api_init', array($this,'blockspare_blocks_register_api_endpoints' ));
33 -
34 -
222 + }
223 + $date_format = date_i18n(get_option('date_format'), current_time('timestamp'));
224 +
225 + $blockData = '';
226 + if (isset($_GET['blockspare_create_block'])) {
227 + $blockName = $_GET['blockspare_create_block'];
228 + $blocks_lists = array();
229 +
230 + $filterdata = apply_filters('blockspare_template_library', $blocks_lists);
231 +
232 + foreach ($filterdata as $block) {
233 + if (isset($block['key']) && $block['key'] === $blockName) {
234 + // Found the block with the desired key, retrieve the content
235 + $blockData = $block['content'];
236 + break; // Stop looping once the desired block is found
237 + }
35 238 }
239 + }
36 240
37 - function blockspare_blocks_block_assets(){
38 - wp_enqueue_style(
39 - 'blockspare-blocks-fontawesome-front',
40 - plugins_url('assets/fontawesome/css/all.css', dirname(__FILE__)),
41 - array()
42 - );
43 - // Load the compiled styles.
44 - wp_enqueue_style(
45 - 'blockspare-frontend-block-style-css',
46 - plugins_url('dist/style-blocks.css', dirname(__FILE__)),
47 - array()
48 - );
49 -
50 -
51 - wp_enqueue_style('slick-css', BLOCKSPARE_PLUGIN_URL . 'assets/slick/css/slick.css', array(), '', 'all');
241 + global $pagenow;
242 + $loadscripton = true;
243 + if ($pagenow !== 'widgets.php' && !is_customize_preview()) {
244 + $loadscripton = false;
245 + }
246 + //$blockspare_current_wp_version = '6.5';
247 + $blockspare_current_wp_version = get_bloginfo('version');
248 +
249 + wp_localize_script(
250 + 'blockspare-blocks-block-js',
251 + 'blockspare_globals',
252 + array(
253 + 'srcUrl' => untrailingslashit(plugins_url('/', BLOCKSPARE_BASE_DIR . '/dist/')),
254 + 'rest_url' => esc_url(rest_url()),
255 + 'img' => $blockspare_priview_img_url,
256 + 'homeUrl' => home_url(),
257 + 'blogUrl' => get_site_url(),
258 + 'menu_img_url' => $blockspare_food_img_url,
259 + 'logo' => $blockspare_dashboard_logo,
260 + 'postTypes' => $this->aft_get_post_types(),
261 + 'taxonomies' => $this->aft_get_taxonomies(),
262 + 'postQueryEndpoint' => 'aft/v1/post-query',
263 + 'config' => '',
264 + 'configuration' => '',
265 + 'settings' => '',
266 + 'bs_date' => $date,
267 + "imagePath" => "https://raw.githubusercontent.com/afthemes/blockspare-demo-data/master/blocks/",
268 + "open_design" => $open_design,
269 + 'date_format ' => $date_format,
270 + 'blockData' => $blockData,
271 + 'template_link' => admin_url('edit.php?post_type=bs_templates'),
272 + 'newTemlateUrl' => admin_url('post-new.php?post_type=bs_templates&blockspare_create_block&blockspare_show_intro=true'),
273 + 'loadscripton' => $loadscripton,
274 + 'wpversion' => (version_compare($blockspare_current_wp_version, '6.6') >= 0) ? 'true' : 'false',
275 + )
276 + );
277 + }
278 +
279 + public function aft_get_post_types()
280 + {
281 + $args = array(
282 + 'public' => true,
283 + 'show_in_rest' => true,
284 + );
285 + $post_types = get_post_types($args, 'objects');
286 + $output = array();
287 + foreach ($post_types as $post_type) {
288 +
289 + if ('attachment' == $post_type->name) {
290 + continue;
52 291 }
292 + $output[] = array(
293 + 'value' => $post_type->name,
294 + 'label' => $post_type->label,
295 + );
296 + }
53 297
54 - 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);
298 + return apply_filters('aft_blocks_post_types', $output);
299 + }
64 300
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 - ));
301 + public function aft_get_taxonomies()
302 + {
303 + $post_types = $this->aft_get_post_types();
304 + $output = array();
305 + foreach ($post_types as $key => $post_type) {
306 + $taxonomies = get_object_taxonomies($post_type['value'], 'objects');
307 + $taxs = array();
308 + foreach ($taxonomies as $term_slug => $term) {
309 + if (!$term->public || !$term->show_ui) {
310 + continue;
311 + }
312 + $taxs[$term_slug] = $term;
313 + $terms = get_terms($term_slug);
314 + $term_items = array();
315 + if (!empty($terms)) {
316 + foreach ($terms as $term_key => $term_item) {
317 + $term_items[] = array(
318 + 'value' => $term_item->term_id,
319 + 'label' => $term_item->name,
320 + );
321 + }
322 + $output[$post_type['value']]['terms'][$term_slug] = $term_items;
323 + }
69 324 }
325 + $output[$post_type['value']]['taxonomy'] = $taxs;
326 + }
70 327
71 - function blockspare_create_block(){
328 + return apply_filters('aft_blocks_taxonomies', $output);
329 + }
72 330
73 - $script_dep_path = BLOCKSPARE_BASE_DIR . 'dist/blocks.asset.php';
74 - $script_info = file_exists($script_dep_path) ? include $script_dep_path : array(
75 - 'dependencies' => array() ,
76 - 'version' => BLOCKSPARE_VERSION,
77 - );
78 - if (version_compare(get_bloginfo('version') , '5.8', '<'))
79 - {
80 - $script_dep = array_merge($script_info['dependencies'],array(
81 - 'wp-blocks',
82 - 'wp-i18n',
83 - 'wp-element',
84 - 'wp-components',
85 - 'wp-editor',
86 - 'wp-api-fetch'
87 - ));
88 - }
89 - else
90 - {
91 - $script_dep = $script_info['dependencies'];
92 - }
331 + public function blockspare_blocks_loader()
332 + {
93 333
94 - wp_enqueue_script('blockspare-blocks-block-js', // Handle.
95 - BLOCKSPARE_PLUGIN_URL . 'dist/blocks.js', $script_dep, // Dependencies, defined above.
96 - $script_info['version'], // AFT_PRICING_TABLE_VERSION.
97 - true
98 - // Enqueue the script in the footer.
99 - );
334 + if (PHP_VERSION_ID >= 50600) {
335 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/class-image-importer.php';
336 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/functions.php';
337 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/registry.php';
338 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/components.php';
100 339
101 - if (is_admin()) :
102 - wp_enqueue_style(
103 - 'blockspare-block-edit-style',
104 - BLOCKSPARE_PLUGIN_URL . 'dist/blocks.css',
105 - array('wp-edit-blocks')
106 - );
107 - endif;
108 -
109 -
110 - $blockspare_priview_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img.jpg';
111 - $blockspare_food_img_url = BLOCKSPARE_PLUGIN_URL . 'assets/blockspare-placeholder-img-square.jpg';
112 -
113 - $taxonomies = get_categories();
114 - $txnm = array();
115 -
116 - foreach( $taxonomies as $type ) {
117 -
118 -
119 - $txnm[] = array(
120 - 'label' => $type->name,
121 - 'value' => $type->term_id,
122 - );
123 - }
124 -
125 -
126 - wp_localize_script(
127 - 'blockspare-blocks-block-js',
128 - 'blockspare_globals',
129 - array(
130 - 'srcUrl' => untrailingslashit(plugins_url('/', BLOCKSPARE_BASE_DIR . '/dist/')),
131 - 'rest_url' => esc_url(rest_url()),
132 - 'img' => $blockspare_priview_img_url,
133 - 'menu_img_url' => $blockspare_food_img_url,
134 - 'postTypes' => $this->aft_get_post_types(),
135 - 'taxonomies' => $this->aft_get_taxonomies(),
136 - 'postQueryEndpoint'=>'aft/v1/post-query',
137 - 'config' => '',
138 - 'configuration' => '',
139 - 'settings' => '',
140 - )
141 - );
142 - }
340 + /**
341 + * REST API Endpoints for Layouts.
342 + */
343 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/endpoints.php';
344 + require_once BLOCKSPARE_PLUGIN_DIR . 'inc/layout/save-templates.php';
143 345
144 - function aft_get_post_types(){
145 - $args = array(
146 - 'public' => true,
147 - 'show_in_rest' => true,
148 - );
149 - $post_types = get_post_types( $args, 'objects' );
150 - $output = array();
151 - foreach ( $post_types as $post_type ) {
152 -
153 - if ( 'attachment' == $post_type->name ) {
154 - continue;
155 - }
156 - $output[] = array(
157 - 'value' => $post_type->name,
158 - 'label' => $post_type->label,
159 - );
160 - }
346 + /**
347 + * Import Pattern
348 + */
161 349
162 - return apply_filters( 'aft_blocks_post_types', $output );
163 - }
350 + // require_once BLOCKSPARE_PLUGIN_DIR . 'inc/pattern/pattern.php';
351 + }
164 352
165 -
353 + //Load Gutenberg Block php Files
354 + include BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/date-time/index.php';
355 + include BLOCKSPARE_PLUGIN_DIR . '/inc/other-block/social-sharing/index.php';
356 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-grid/index.php';
357 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-list/index.php';
166 358
167 - function aft_get_taxonomies() {
168 - $post_types = $this->aft_get_post_types();
169 - $output = array();
170 - foreach ( $post_types as $key => $post_type ) {
171 - $taxonomies = get_object_taxonomies( $post_type['value'], 'objects' );
172 - $taxs = array();
173 - foreach ( $taxonomies as $term_slug => $term ) {
174 - if ( ! $term->public || ! $term->show_ui ) {
175 - continue;
176 - }
177 - $taxs[ $term_slug ] = $term;
178 - $terms = get_terms( $term_slug );
179 - $term_items = array();
180 - if ( ! empty( $terms ) ) {
181 - foreach ( $terms as $term_key => $term_item ) {
182 - $term_items[] = array(
183 - 'value' => $term_item->term_id,
184 - 'label' => $term_item->name,
185 - );
186 - }
187 - $output[ $post_type['value'] ]['terms'][ $term_slug ] = $term_items;
188 - }
189 - }
190 - $output[ $post_type['value'] ]['taxonomy'] = $taxs;
191 - }
192 -
193 - return apply_filters( 'aft_blocks_taxonomies', $output );
194 - }
359 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/index.php';
360 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/post-content.php';
195 361
196 - function blockspare_blocks_loader(){
197 -
198 - //Load Gutenberg Block php Files
199 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/date-time/index.php');
200 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/other-block/social-sharing/index.php');
201 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-grid/index.php');
202 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-list/index.php');
203 -
204 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-express-grid/index.php');
205 -
206 -
207 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-carousel-grid/index.php');
208 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-slider/index.php');
209 -
210 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-1/index.php');
211 - include(BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-2/index.php');
212 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/ajax-pagination.php');
213 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-post-rest-api.php');
214 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-backend.php');
215 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-frontend.php');
216 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/tax-category.php');
217 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-bs-post.php');
218 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-config.php');
219 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-style.php');
220 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/search/index.php');
221 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/latest-post-block/posts-flash/index.php');
222 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/popular-tags/index.php');
223 - include(BLOCKSPARE_PLUGIN_DIR . 'inc/page-templates/module.php');
224 - }
362 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-carousel-grid/index.php';
363 + include BLOCKSPARE_PLUGIN_DIR . '/inc/latest-post-block/posts-slider/index.php';
225 364
226 - function blockspare_blocks_register_api_endpoints(){
227 -
228 - $posts_controller = new Aft_Post_Rest_Controller();
229 - $posts_controller->register_routes();
230 -
365 + include BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-1/index.php';
366 + include BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-2/index.php';
367 + include BLOCKSPARE_PLUGIN_DIR . '/inc/post-banner/banner-9/index.php';
368 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/ajax-pagination.php';
369 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-post-rest-api.php';
370 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-backend.php';
371 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-multiauthor-frontend.php';
372 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/tax-category.php';
373 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-posts-config/class-bs-post.php';
374 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-config.php';
375 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-banner-style.php';
376 + include BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/search/index.php';
377 + include BLOCKSPARE_PLUGIN_DIR . 'inc/latest-post-block/posts-flash/index.php';
378 + include BLOCKSPARE_PLUGIN_DIR . 'inc/other-block/popular-tags/index.php';
379 + include BLOCKSPARE_PLUGIN_DIR . 'inc/page-templates/module.php';
380 + include BLOCKSPARE_PLUGIN_DIR . 'inc/block-banner/frontend-render/post-category-style.php';
381 + }
231 382
232 - }
383 + public function blockspare_blocks_register_api_endpoints()
384 + {
233 385
386 + $posts_controller = new Aft_Post_Rest_Controller();
387 + $posts_controller->register_routes();
234 388 }
235 - BlockspareInit::get_instance();
389 + }
390 + BlockspareInit::get_instance();
236 391 }
237 -
238 -
239 -