PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / trunk
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites vtrunk
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 +27 -2 4.1.0trunk View file →
@@ -314,10 +314,15 @@
314 314 $open_design = isset($_GET['blockspare_show_intro']) && $_GET['blockspare_show_intro'] === 'true';
315 315 $blockData = '';
316 316
317 317 if (isset($_GET['blockspare_create_block'])) {
318 +
318 319 $blockName = sanitize_text_field($_GET['blockspare_create_block']);
320 + $blockTitle = sanitize_text_field($_GET['post_title']);
321 +
322 + // Get from template library filter
319 323 $filterdata = apply_filters('blockspare_template_library', []);
324 +
320 325 foreach ($filterdata as $block) {
321 326 if (isset($block['key']) && $block['key'] === $blockName) {
322 327 $blockData = $block['content'];
323 328 break;
@@ -322,8 +327,23 @@
322 327 $blockData = $block['content'];
323 328 break;
324 329 }
325 330 }
331 +
332 + // Get from bs_templates post type if not found
333 + if (empty($blockData) && ! empty($blockTitle)) {
334 +
335 + $templates = get_posts([
336 + 'post_type' => 'bs_templates',
337 + 'post_status' => 'publish',
338 + 'title' => $blockTitle,
339 + 'posts_per_page' => 1,
340 + ]);
341 +
342 + if (! empty($templates)) {
343 + $blockData = $templates[0]->post_content;
344 + }
345 + }
326 346 }
327 347
328 348 $blockspare_current_wp_version = get_bloginfo('version');
329 349 $loadscripton = (isset($GLOBALS['pagenow']) && $GLOBALS['pagenow'] === 'widgets.php') || is_customize_preview();
@@ -355,10 +375,15 @@
355 375 'wpversion' => (version_compare($blockspare_current_wp_version, '6.6') >= 0) ? 'true' : 'false',
356 376 'inspector_imgs' => BLOCKSPARE_PLUGIN_URL . 'assets/images',
357 377 'upgradeUrl' => 'https://afthemes.com/blockspare-pro/',
358 378 'isPro' => false,
379 + 'allowedFonts' => $this->blockspare_allow_fonts()
359 380 ];
360 381 }
382 + public function blockspare_allow_fonts()
383 + {
384 + return ['ABeeZee', 'Abel', 'Lato', 'Oswald'];
385 + }
361 386
362 387 public function blockspare_fb_enqueue_frontend_assets()
363 388 {
364 389 wp_enqueue_style(
@@ -395,14 +420,14 @@
395 420 {
396 421 $custom = [
397 422 [
398 423 'slug' => 'blockspare-post',
399 - 'title' => __('News and Magazine', 'blockspare'),
424 + 'title' => __('Editorial & Content', 'blockspare'),
400 425
401 426 ],
402 427 [
403 428 'slug' => 'blockspare',
404 - 'title' => __('Business', 'blockspare'),
429 + 'title' => __('Business & Layout', 'blockspare'),
405 430
406 431 ],
407 432
408 433 ];