PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.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 1.1.0 1.1.1 All 81 releases
← All changes | includes/assets.php +35 -4 2.12.0 → 2.14.0 View file →
@@ -9,8 +9,9 @@
9 9 use ABlocks\Classes\AssetsGenerator;
10 10 use ABlocks\Classes\RegisterScripts;
11 11 use ABlocks\Classes\GlobalCssGenerator;
12 12 use ABlocks\Classes\GlobalClasses;
13 +use ABlocks\Classes\AtomicStyles;
13 14 use ABlocks\Classes\FontLoadLocally;
14 15 use ABlocks\Admin\Menu;
15 16 use ABlocks\Helper;
16 17
@@ -215,8 +216,11 @@
215 216 'academy_lms' => Helper::is_active_academy(),
216 217 'storeengine' => Helper::is_active_storeengine(),
217 218 'wp_map_block' => Helper::is_active_wp_map_block(),
218 219 'easy_content_manager' => Helper::is_active_easy_content_manager(),
220 + 'zencommunity' => Helper::is_active_zencommunity(),
221 + 'gemboards' => Helper::is_active_gemboards(),
222 + 'quizpress' => Helper::is_active_quizpress(),
219 223 ]
220 224 );
221 225 return apply_filters(
222 226 'ablocks/assets/dashboard_scripts_data',
@@ -878,12 +882,17 @@
878 882 */
879 883 public static function build_revision() {
880 884 $stamp = get_option( self::BUILD_OPTION );
881 885
886 + // The compiler's output revision is part of the key, so an emission
887 + // change stales every baked page even without a version bump. See
888 + // AtomicStyles::OUTPUT_REVISION.
889 + $build = ABLOCKS_VERSION . '+' . AtomicStyles::OUTPUT_REVISION;
890 +
882 891 if (
883 892 is_array( $stamp ) &&
884 893 isset( $stamp['version'], $stamp['time'] ) &&
885 - ABLOCKS_VERSION === $stamp['version']
894 + $build === $stamp['version']
886 895 ) {
887 896 return (int) $stamp['time'];
888 897 }
889 898
@@ -890,9 +899,9 @@
890 899 $now = time();
891 900 update_option(
892 901 self::BUILD_OPTION,
893 902 [
894 - 'version' => ABLOCKS_VERSION,
903 + 'version' => $build,
895 904 'time' => $now,
896 905 ],
897 906 true
898 907 );
@@ -902,17 +911,39 @@
902 911
903 912 public function set_current_page_template_part( $content, $block ) {
904 913 if ( ! isset( $block['blockName'] ) && is_array( $block ) ) {
905 914 foreach ( $block as $block_item ) {
906 - if ( ! empty( $block_item['blockName'] ) && strpos( $block_item['blockName'], 'ablocks/' ) !== false ) {
915 + if ( $this->is_page_asset_block( $block_item ) ) {
907 916 $this->current_page_blocks[] = $block_item;
908 917 }
909 918 }
910 919 }
911 - if ( ! empty( $block['blockName'] ) && strpos( $block['blockName'], 'ablocks/' ) !== false ) {
920 + if ( $this->is_page_asset_block( $block ) ) {
912 921 $this->current_page_blocks[] = $block;
913 922 }
914 923 return $content;
924 + }
925 +
926 + /**
927 + * Whether a top-level block contributes to the page's generated assets.
928 + *
929 + * A synced pattern counts too: AssetsGenerator::recursive_block_parser()
930 + * already expands its reference. Collecting only `ablocks/*` names left a
931 + * page whose content is just a pattern with no combined CSS/JS at all — so a
932 + * Loop Filter placed from a pattern rendered unstyled and did nothing when
933 + * clicked.
934 + *
935 + * @param mixed $block Parsed block.
936 + * @return bool
937 + */
938 + private function is_page_asset_block( $block ) {
939 + if ( ! is_array( $block ) || empty( $block['blockName'] ) ) {
940 + return false;
941 + }
942 + if ( 'core/block' === $block['blockName'] ) {
943 + return ! empty( $block['attrs']['ref'] );
944 + }
945 + return strpos( $block['blockName'], 'ablocks/' ) !== false;
915 946 }
916 947
917 948 public function set_theme_builder_locations( $args ) {
918 949 $this->theme_builder_locations = $args;