PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.1.8
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.1.8
2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 All 108 releases
← All changes | includes/EnqueueScripts.php +8 -1 2.1.0 → 2.1.8 View file →
@@ -22,9 +22,16 @@
22 22 $disabledBlocks = get_option( 'bBlocksDisabledBlocks', [] );
23 23 $disabledBlocks = is_array( $disabledBlocks ) ? $disabledBlocks : [];
24 24 wp_localize_script( 'b-blocks-index-script', 'bBlocksDisabledBlocks', $disabledBlocks );
25 25
26 - wp_localize_script( 'b-blocks-index-script', 'bBlocksGlobal', [ 'assetsUrl' => B_BLOCKS_ASSETS ] );
26 + // `canUnfilteredHtml` gates the HTML block's script activation in the
27 + // editor preview (see src/html/Components/hooks/useRunJs.js). Note
28 + // that wp_localize_script() casts scalars to strings, so this
29 + // arrives in JS as '1' or '' - read it for truthiness, not === true.
30 + wp_localize_script( 'b-blocks-index-script', 'bBlocksGlobal', [
31 + 'assetsUrl' => B_BLOCKS_ASSETS,
32 + 'canUnfilteredHtml' => current_user_can( 'unfiltered_html' ),
33 + ] );
27 34
28 35 wp_enqueue_style( 'b-blocks-index-style', B_BLOCKS_BUILD . 'index.css', [ 'fontAwesome', 'b-blocks-style' ], B_BLOCKS_VERSION );
29 36
30 37 wp_add_inline_script('b-blocks-index-script', 'const bBlocksPremiumChecker = ' . wp_json_encode( BBlocks\Inc\Utils::isPro() ) . '; ', 'before' );