PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.16.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.16.0
2.16.0 2.15.0 2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 All 83 releases
← All changes | includes/assets.php +298 -11 2.10.0 → 2.16.0 View file →
@@ -8,13 +8,19 @@
8 8 use ABlocks\Classes\FileUpload;
9 9 use ABlocks\Classes\AssetsGenerator;
10 10 use ABlocks\Classes\RegisterScripts;
11 11 use ABlocks\Classes\GlobalCssGenerator;
12 +use ABlocks\Classes\GlobalClasses;
13 +use ABlocks\Classes\AtomicStyles;
12 14 use ABlocks\Classes\FontLoadLocally;
13 15 use ABlocks\Admin\Menu;
14 16 use ABlocks\Helper;
15 17
16 18 class Assets {
19 +
20 + /** Records which plugin version last generated the page stylesheets. */
21 + const BUILD_OPTION = 'ablocks_assets_build';
22 +
17 23 public $current_page_template_part = [];
18 24 public $current_page_blocks = [];
19 25 private $FileUpload;
20 26 private $current_page_slug = '';
@@ -37,8 +43,14 @@
37 43 add_action( 'enqueue_block_editor_assets', [ $self, 'global_css_variable' ] );
38 44 add_action( 'enqueue_block_editor_assets', [ $self, 'add_editor_inline_css' ] );
39 45 add_action( 'enqueue_block_editor_assets', [ $self, 'editor_google_fonts' ] );
40 46
47 + // The localized ablocks_nonce is minted once per page load, so a tab left
48 + // open past the nonce lifetime (or across a re-login) 403s on every
49 + // aBlocks request. Renew it the way core renews wp_rest.
50 + add_filter( 'wp_refresh_nonces', [ $self, 'refresh_heartbeat_nonce' ] );
51 + add_action( 'wp_ajax_ablocks/refresh_nonce', [ $self, 'ajax_refresh_nonce' ] );
52 +
41 53 // Detect page
42 54 add_action( 'wp', array( $self, 'detect_page' ) );
43 55
44 56 if ( ! is_admin() && Helper::is_enabled_assets_generation() ) {
@@ -106,18 +118,32 @@
106 118 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
107 119 'is_pro' => (bool) Helper::is_active_ablocks_pro(),
108 120 'is_archive' => (bool) is_archive(),
109 121 'archive_post_type' => $this->get_current_archive_post_type(),
122 + // Responsive breakpoint widths (px) shared with the JS CSS generators
123 + // and the block editor so media queries match the frontend.
124 + 'breakpoints' => Helper::get_breakpoints(),
125 + // Ordered device list (Desktop + built-ins + custom breakpoints) for
126 + // the atomic block's responsive device switcher. Widest-first, so
127 + // the editor and the frontend agree on breakpoint precedence.
128 + 'responsive_devices' => Helper::get_responsive_devices(),
129 + // Whether breakpoint queries overlap (cascade) or are exclusive
130 + // bands (strict). The editor preview builds matching queries.
131 + 'breakpoint_mode' => Helper::get_breakpoint_mode(),
110 132 ];
111 133 }
112 134
113 135 public function get_localize_dashboard_data() {
114 - if ( ! current_user_can( 'manage_options' ) ) {
136 + // Anyone permitted to reach an aBlocks screen needs the nonce, or the
137 + // dashboard loads and then 403s on every request it makes.
138 + if ( ! current_user_can( Permissions::ACCESS ) ) {
115 139 return $this->get_localize_script_data();
116 140 }
117 141 return array_merge($this->get_localize_script_data(), [
118 142 'nonce' => wp_create_nonce( 'wp_rest' ),
119 143 'ablocks_nonce' => wp_create_nonce( 'ablocks_nonce' ),
144 + 'permissions' => Permissions::for_user(),
145 + 'is_admin_user' => Permissions::is_real_admin(),
120 146 ]);
121 147 }
122 148 public function get_localize_editor_data() {
123 149 if ( ! current_user_can( 'edit_posts' ) ) {
@@ -128,14 +154,85 @@
128 154 'ablocks_nonce' => wp_create_nonce( 'ablocks_nonce' ),
129 155 ]);
130 156 }
131 157 public function get_localize_frontend_data() {
132 - return array_merge($this->get_localize_script_data(), [
158 + $data = array_merge($this->get_localize_script_data(), [
133 159 'nonce' => wp_create_nonce( 'wp_rest' ),
134 160 'ablocks_nonce' => wp_create_nonce( 'ablocks_nonce' ),
135 161 ]);
162 + // The absolute server path is only meaningful to admin-side code; on the
163 + // frontend it would publish the filesystem layout in page source. No
164 + // frontend script reads it (it is re-exported but never consumed).
165 + unset( $data['plugin_root_path'] );
166 + return $data;
136 167 }
137 168
169 + /**
170 + * Whether the current user is issued ablocks_nonce in the editor or the
171 + * dashboard, and so may have it renewed. Mirrors the gates above.
172 + */
173 + private function can_renew_nonce() {
174 + return is_user_logged_in() && ( current_user_can( 'edit_posts' ) || current_user_can( Permissions::ACCESS ) );
175 + }
176 +
177 + /**
178 + * Heartbeat: hand an open page a fresh ablocks_nonce whenever core refreshes
179 + * its own nonces (the page's nonces are ageing, or the session changed).
180 + *
181 + * @param array $response The Heartbeat response.
182 + * @return array
183 + */
184 + public function refresh_heartbeat_nonce( $response ) {
185 + if ( $this->can_renew_nonce() ) {
186 + $response['ablocks_nonce'] = wp_create_nonce( 'ablocks_nonce' );
187 + }
188 + return $response;
189 + }
190 +
191 + /**
192 + * A fresh ablocks_nonce for a request that was rejected with a stale one —
193 + * the aBlocks counterpart of core's `rest-nonce` action. Logged-in only, and
194 + * only for users who would be given the nonce on page load anyway.
195 + */
196 + public function ajax_refresh_nonce() {
197 + if ( ! $this->can_renew_nonce() ) {
198 + wp_send_json_error( [ 'message' => 'forbidden' ], 403 );
199 + }
200 + wp_send_json_success( [ 'nonce' => wp_create_nonce( 'ablocks_nonce' ) ] );
201 + }
202 +
203 + /**
204 + * Whether the frontend ABlocksGlobal payload has been attached this request.
205 + *
206 + * @var bool
207 + */
208 + private static $globals_localized = false;
209 +
210 + /**
211 + * Attach the frontend ABlocksGlobal payload to the shared data-only
212 + * `ablocks-globals` handle, at most once per request.
213 + *
214 + * Previously each per-block script handle localized its own copy, so a page
215 + * using N block types printed N identical `var ABlocksGlobal = {...}` blocks
216 + * (and called wp_create_nonce() N times). Every aBlocks frontend script now
217 + * depends on `ablocks-globals`, so WP prints the object once, before any
218 + * consumer, in both asset-generation modes.
219 + */
220 + public static function localize_globals_once() {
221 + if ( self::$globals_localized ) {
222 + return;
223 + }
224 + self::$globals_localized = true;
225 + // Self-register so callers never depend on RegisterScripts having run
226 + // first — theme-builder templates and block render callbacks fire on
227 + // different hooks, and a missing handle would drop the payload silently.
228 + if ( ! wp_script_is( 'ablocks-globals', 'registered' ) ) {
229 + wp_register_script( 'ablocks-globals', false, array(), ABLOCKS_VERSION, array() );
230 + }
231 + $self = new self();
232 + wp_localize_script( 'ablocks-globals', 'ABlocksGlobal', $self->get_localize_frontend_data() );
233 + }
234 +
138 235 public function get_dashboard_localize_script_data() {
139 236 $menu = new Menu();
140 237 $args = array(
141 238 'menu' => wp_json_encode( Helper::get_admin_menu_list() ),
@@ -148,8 +245,11 @@
148 245 'enabled_block_copy_paste_style' => (bool) Helper::get_settings( 'enabled_block_copy_paste_style', false ),
149 246 'enabled_load_google_font_locally' => (bool) Helper::get_settings( 'enabled_load_google_font_locally', false ),
150 247 'enabled_only_selected_fonts' => (bool) Helper::get_settings( 'enabled_only_selected_fonts', false ),
151 248 'selected_fonts' => (array) Helper::get_settings( 'selected_fonts', [] ),
249 + 'font_metric_fallback' => (bool) Helper::get_settings( 'font_metric_fallback', true ),
250 + // Global typography picks from the same list the editor offers.
251 + 'theme_fonts' => \ABlocks\Classes\FontStack::get_theme_font_families(),
152 252 ],
153 253 'is_gutenberg_editor' => Helper::is_gutenberg_editor(),
154 254 'is_fse_theme' => Helper::is_fse_theme(),
155 255 'third_party_plugin_status' => [
@@ -156,8 +256,11 @@
156 256 'academy_lms' => Helper::is_active_academy(),
157 257 'storeengine' => Helper::is_active_storeengine(),
158 258 'wp_map_block' => Helper::is_active_wp_map_block(),
159 259 'easy_content_manager' => Helper::is_active_easy_content_manager(),
260 + 'zencommunity' => Helper::is_active_zencommunity(),
261 + 'gemboards' => Helper::is_active_gemboards(),
262 + 'quizpress' => Helper::is_active_quizpress(),
160 263 ]
161 264 );
162 265 return apply_filters(
163 266 'ablocks/assets/dashboard_scripts_data',
@@ -179,13 +282,24 @@
179 282 'enabled_block_copy_paste_style' => (bool) Helper::get_settings( 'enabled_block_copy_paste_style', false ),
180 283 'enabled_load_google_font_locally' => (bool) Helper::get_settings( 'enabled_load_google_font_locally', false ),
181 284 'enabled_only_selected_fonts' => (bool) Helper::get_settings( 'enabled_only_selected_fonts', false ),
182 285 'selected_fonts' => (array) Helper::get_settings( 'selected_fonts', [] ),
286 + // Design system lock — the editor hides the custom pickers when these
287 + // are on, leaving only the global presets.
288 + 'lock_global_typography' => (bool) Helper::get_settings( 'lock_global_typography', false ),
289 + 'lock_global_typography_strict' => (bool) Helper::get_settings( 'lock_global_typography_strict', false ),
290 + 'lock_global_colors' => (bool) Helper::get_settings( 'lock_global_colors', false ),
183 291 'frontend_dashboard_page' => (int) Helper::get_settings( 'frontend_dashboard_page' ),
184 292 'global_color' => (array) Helper::get_settings( 'global_color', [] ),
185 293 'global_typography' => (array) Helper::get_settings( 'global_typography', [] ),
186 294 'global_typography_list' => wp_list_pluck( Helper::get_settings( 'global_typography', [] ), 'value', 'id' ),
187 295 'global_font_family_fallback' => (string) Helper::get_settings( 'global_font_family_fallback', 'Sans-serif' ),
296 + // Editor paste — see includes/api/paste-controller.php.
297 + 'paste_google_docs' => (bool) Helper::get_settings( 'paste_google_docs', true ),
298 + 'paste_convert_webp' => (bool) Helper::get_settings( 'paste_convert_webp', true ),
299 + // Theme.json + Font Library families, so uploaded/theme fonts are
300 + // selectable next to the Google catalog.
301 + 'theme_fonts' => \ABlocks\Classes\FontStack::get_theme_font_families(),
188 302 ],
189 303 'is_gutenberg_editor' => Helper::is_gutenberg_editor(),
190 304 'has_required_block_attribute_migration' => get_option( 'ablocks_has_required_block_attribute_migration' ),
191 305 'third_party_plugin_status' => [
@@ -195,9 +309,13 @@
195 309 'quizpress' => Helper::is_active_quizpress(),
196 310 'easy_content_manager' => Helper::is_active_easy_content_manager(),
197 311 ],
198 312 'blocks_status' => $ablocks_blocks,
199 - 'post_types' => $post_types
313 + 'post_types' => $post_types,
314 + // What this user may do inside the editor. Read by
315 + // src/utils/permissions.js to hide controls they cannot use.
316 + 'permissions' => Permissions::for_user(),
317 + 'is_admin_user' => Permissions::is_real_admin(),
200 318 );
201 319 return apply_filters(
202 320 'ablocks/assets/editor_scripts_data',
203 321 array_merge(
@@ -382,12 +500,49 @@
382 500 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
383 501 wp_add_inline_style( 'ablocks-blocks-combine-style', (string) file_get_contents( $css_path ) );
384 502 } else {
385 503 wp_enqueue_style( 'ablocks-blocks-combine-style', $this->FileUpload->get_file_url( $this->current_page_slug . '.min.css' ), array(), filemtime( $css_path ), 'all' );
504 +
505 + // Performance Suite — when the page stylesheet is too large to inline,
506 + // load it non-blocking (media="print" + onload swap) so it no longer
507 + // delays first paint. Opt-in via perf_async_css (default off: a too-
508 + // aggressive critical set risks FOUC, so promote after QA). Editors
509 + // viewing the frontend are bypassed so previews render immediately.
510 + $async_css = (bool) apply_filters(
511 + 'ablocks/perf/perf_async_css',
512 + (bool) Helper::get_settings( 'perf_async_css', false )
513 + );
514 + // Critical CSS — inline the above-the-fold/structural subset in
515 + // <head> and load the full stylesheet non-blocking. This is a
516 + // stronger form of async (it prevents the FOUC async alone can
517 + // cause), so enabling it implies async delivery of the full file.
518 + $critical_css = (bool) apply_filters(
519 + 'ablocks/perf/perf_critical_css',
520 + (bool) Helper::get_settings( 'perf_critical_css', false )
521 + );
522 + $bypass_for_editor = is_user_logged_in() && current_user_can( 'edit_posts' )
523 + && (bool) apply_filters( 'ablocks/perf/bypass_optimizations_for_editors', true );
524 +
525 + if ( ( $async_css || $critical_css ) && ! $bypass_for_editor ) {
526 + // Before deferring the full stylesheet, always inline the
527 + // layout-critical CSS so the page paints with correct box
528 + // sizes and never reflows when the deferred file loads. The
529 + // split is property-based: the deferred remainder is cosmetic
530 + // only (colors, shadows, hover states), so it cannot cause a
531 + // layout shift (CLS). This makes async delivery safe.
532 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
533 + list( $critical ) = \ABlocks\Classes\CriticalCss::split( (string) file_get_contents( $css_path ) );
534 + if ( '' !== trim( (string) $critical ) ) {
535 + wp_register_style( 'ablocks-critical-css', false, array(), ABLOCKS_VERSION );
536 + wp_enqueue_style( 'ablocks-critical-css' );
537 + wp_add_inline_style( 'ablocks-critical-css', $critical );
538 + }
539 + add_filter( 'style_loader_tag', [ $this, 'async_combined_style_tag' ], 20, 2 );
540 + }
386 541 }
387 542
388 - wp_enqueue_script( 'ablocks-blocks-combine-script', $this->FileUpload->get_file_url( $this->current_page_slug . '.min.js' ), array(), filemtime( $this->FileUpload->get_file_path( $this->current_page_slug . '.min.js' ) ), true, [ 'strategy' => $script_loading_strategy ] );
389 - wp_localize_script( 'ablocks-blocks-combine-script', 'ABlocksGlobal', $this->get_localize_frontend_data() );
543 + wp_enqueue_script( 'ablocks-blocks-combine-script', $this->FileUpload->get_file_url( $this->current_page_slug . '.min.js' ), array( 'ablocks-globals' ), filemtime( $this->FileUpload->get_file_path( $this->current_page_slug . '.min.js' ) ), true, [ 'strategy' => $script_loading_strategy ] );
544 + self::localize_globals_once();
390 545 wp_set_script_translations( 'ablocks-blocks-combine-script', 'ablocks', ABLOCKS_ROOT_DIR_PATH . 'languages' );
391 546 } else {
392 547 // fallback if assets not available
393 548 add_filter( 'ablocks/is_allow_block_inline_assets', '__return_true' );
@@ -393,8 +548,31 @@
393 548 add_filter( 'ablocks/is_allow_block_inline_assets', '__return_true' );
394 549 }
395 550 }
396 551
552 + /**
553 + * Rewrite the combined page stylesheet <link> so it loads without blocking
554 + * render: fetch as media="print", then flip to media="all" on load, with a
555 + * <noscript> fallback for JS-disabled clients. Only touches the aBlocks
556 + * combined handle — third-party stylesheets are left untouched.
557 + */
558 + public function async_combined_style_tag( $tag, $handle ) {
559 + if ( 'ablocks-blocks-combine-style' !== $handle ) {
560 + return $tag;
561 + }
562 + $async_tag = preg_replace(
563 + [ "/media=(['\"])[^'\"]*\\1/", '/>$/', '/\/>$/' ],
564 + [ 'media="print" onload="this.media=\'all\'"', '>', '/>' ],
565 + trim( $tag )
566 + );
567 + // Guarantee the print/onload attributes even if the original tag had no media.
568 + if ( strpos( $async_tag, 'onload=' ) === false ) {
569 + $async_tag = str_replace( '<link ', '<link media="print" onload="this.media=\'all\'" ', $async_tag );
570 + }
571 + $noscript = '<noscript>' . $tag . '</noscript>';
572 + return $async_tag . "\n" . $noscript;
573 + }
574 +
397 575 public function regenerate_missing_assets() {
398 576 if ( $this->is_assets_generated() ) {
399 577 return;
400 578 }
@@ -436,9 +614,20 @@
436 614 $register_scripts = RegisterScripts::get_register_scripts();
437 615 foreach ( $register_scripts as $register_handler => $register_script ) {
438 616 if ( isset( $register_script['dependencies'] ) ) {
439 617 $dependencies = include $register_script['dependencies'];
440 - $register_script['deps'] = $dependencies['dependencies'];
618 + // Merge rather than overwrite: the generated asset.php only knows
619 + // about build-time (@wordpress/*) dependencies, so replacing the
620 + // declared list would silently drop hand-declared handles such as
621 + // ablocks-globals.
622 + $register_script['deps'] = array_values(
623 + array_unique(
624 + array_merge(
625 + isset( $register_script['deps'] ) ? (array) $register_script['deps'] : array(),
626 + $dependencies['dependencies']
627 + )
628 + )
629 + );
441 630 $register_script['ver'] = $dependencies['version'];
442 631 }
443 632 wp_register_script(
444 633 $register_handler,
@@ -446,9 +635,9 @@
446 635 $register_script['deps'],
447 636 $register_script['ver'],
448 637 $register_script['args']
449 638 );
450 - }
639 + }//end foreach
451 640 }
452 641 public function global_css_variable() {
453 642 wp_register_style( 'ablocks-editor-global-styles', false, array(), ABLOCKS_VERSION );
454 643 wp_enqueue_style( 'ablocks-editor-global-styles' );
@@ -478,9 +667,17 @@
478 667 $value = $typography->value;
479 668
480 669 // Desktop values
481 670 if ( ! empty( $value->fontFamily ) ) {
482 - $css .= " --ablocks-{$id}-font-family: {$value->fontFamily};\n";
671 + // Every consumer of this variable drops it straight into
672 + // font-family, so it has to carry the whole stack.
673 + $font_stack = \ABlocks\Classes\FontStack::build(
674 + $value->fontFamily,
675 + isset( $value->fontFallback ) ? $value->fontFallback : ''
676 + );
677 + if ( '' !== $font_stack ) {
678 + $css .= " --ablocks-{$id}-font-family: {$font_stack};\n";
679 + }
483 680 }
484 681 if ( ! empty( $value->weight ) ) {
485 682 $css .= " --ablocks-{$id}-weight: {$value->weight};\n";
486 683 }
@@ -680,23 +877,113 @@
680 877
681 878 public function is_assets_generated() {
682 879 $file_name = $this->current_page_slug;
683 880 $css_file_path = $this->FileUpload->get_file_path( $file_name . '.min.css' );
684 - return file_exists( $css_file_path );
881 +
882 + if ( ! file_exists( $css_file_path ) ) {
883 + return false;
884 + }
885 +
886 + // The file embeds the global-class CSS this page needs, so editing a
887 + // class has to make every generated stylesheet stale. Comparing the
888 + // file's mtime against the library's change stamp rebuilds them lazily,
889 + // one page at a time on next visit, without stamping a revision into
890 + // every file name (which the per-post delete in Blocks relies on).
891 + //
892 + // Strictly greater, not >=: mtime has one-second resolution, so a file
893 + // written in the same second as a class edit is indistinguishable from
894 + // one written just after it. Treating that tie as stale costs one extra
895 + // regeneration; treating it as fresh would serve the old CSS until the
896 + // next edit.
897 + return filemtime( $css_file_path ) > max(
898 + GlobalClasses::get_revision(),
899 + self::build_revision()
900 + );
685 901 }
686 902
903 + /**
904 + * When this plugin's own CSS last changed, as a timestamp.
905 + *
906 + * The generated file bakes in each block's static stylesheet (see
907 + * AssetsGenerator, which concatenates get_static_css() into it), so a CSS
908 + * fix shipped in an update reached nobody whose pages were generated before
909 + * it: the file still existed, still parsed, and nothing about it looked
910 + * stale, so it was served unchanged forever. Verified by planting a
911 + * stylesheet carrying the previous release's rules — it survived every
912 + * subsequent page load untouched. That is why a fix could land in the
913 + * editor, which loads each block's style.css directly, and never appear on
914 + * the front end.
915 + *
916 + * Keyed on the version rather than a file scan: it is one option read on
917 + * the common path, and every shipped CSS change comes with a version bump.
918 + * Each page then rebuilds once, on its next visit, exactly the way a
919 + * global-class edit already makes them rebuild.
920 + *
921 + * @return int Timestamp of the running version's first request.
922 + */
923 + public static function build_revision() {
924 + $stamp = get_option( self::BUILD_OPTION );
925 +
926 + // The compiler's output revision is part of the key, so an emission
927 + // change stales every baked page even without a version bump. See
928 + // AtomicStyles::OUTPUT_REVISION.
929 + $build = ABLOCKS_VERSION . '+' . AtomicStyles::OUTPUT_REVISION;
930 +
931 + if (
932 + is_array( $stamp ) &&
933 + isset( $stamp['version'], $stamp['time'] ) &&
934 + $build === $stamp['version']
935 + ) {
936 + return (int) $stamp['time'];
937 + }
938 +
939 + $now = time();
940 + update_option(
941 + self::BUILD_OPTION,
942 + [
943 + 'version' => $build,
944 + 'time' => $now,
945 + ],
946 + true
947 + );
948 +
949 + return $now;
950 + }
951 +
687 952 public function set_current_page_template_part( $content, $block ) {
688 953 if ( ! isset( $block['blockName'] ) && is_array( $block ) ) {
689 954 foreach ( $block as $block_item ) {
690 - if ( ! empty( $block_item['blockName'] ) && strpos( $block_item['blockName'], 'ablocks/' ) !== false ) {
955 + if ( $this->is_page_asset_block( $block_item ) ) {
691 956 $this->current_page_blocks[] = $block_item;
692 957 }
693 958 }
694 959 }
695 - if ( ! empty( $block['blockName'] ) && strpos( $block['blockName'], 'ablocks/' ) !== false ) {
960 + if ( $this->is_page_asset_block( $block ) ) {
696 961 $this->current_page_blocks[] = $block;
697 962 }
698 963 return $content;
964 + }
965 +
966 + /**
967 + * Whether a top-level block contributes to the page's generated assets.
968 + *
969 + * A synced pattern counts too: AssetsGenerator::recursive_block_parser()
970 + * already expands its reference. Collecting only `ablocks/*` names left a
971 + * page whose content is just a pattern with no combined CSS/JS at all — so a
972 + * Loop Filter placed from a pattern rendered unstyled and did nothing when
973 + * clicked.
974 + *
975 + * @param mixed $block Parsed block.
976 + * @return bool
977 + */
978 + private function is_page_asset_block( $block ) {
979 + if ( ! is_array( $block ) || empty( $block['blockName'] ) ) {
980 + return false;
981 + }
982 + if ( 'core/block' === $block['blockName'] ) {
983 + return ! empty( $block['attrs']['ref'] );
984 + }
985 + return strpos( $block['blockName'], 'ablocks/' ) !== false;
699 986 }
700 987
701 988 public function set_theme_builder_locations( $args ) {
702 989 $this->theme_builder_locations = $args;