Skip to content

Commit

Permalink
Merge pull request #86 from tomusborne/release/1.3.5
Browse files Browse the repository at this point in the history
Release 1.3.5
  • Loading branch information
tomusborne authored Jul 19, 2021
2 parents e59fbb9 + 88fc777 commit 72712a2
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 67 deletions.
2 changes: 1 addition & 1 deletion dist/blocks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-richText'), 'version' => '89e58094373af458fcef2a1a233701dd');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '55e5757e383b547b2609885572d12862');
26 changes: 6 additions & 20 deletions dist/blocks.css

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions dist/blocks.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dashboard.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '515de42fcb4fc24be67de1550c33df60');
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '42b3224ccb277112e40f383393f2ba5e');
1 change: 0 additions & 1 deletion dist/dashboard.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/dashboard.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion includes/class-enqueue-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct() {
add_action( 'save_post_wp_block', array( $this, 'wp_block_update' ), 10, 2 );
add_action( 'init', array( $this, 'enqueue_assets' ) );
add_filter( 'widget_update_callback', array( $this, 'force_file_regen_on_widget_save' ) );
add_action( 'customize_save_after', array( $this, 'force_file_regen_on_customizer_save' ) );
}

/**
Expand Down Expand Up @@ -443,10 +444,24 @@ public function update_saved_time() {
* @param array $instance The current widget instance's settings.
*/
public function force_file_regen_on_widget_save( $instance ) {
update_option( 'generateblocks_dynamic_css_posts', array() );
if ( function_exists( 'wp_use_widgets_block_editor' ) && wp_use_widgets_block_editor() ) {
update_option( 'generateblocks_dynamic_css_posts', array() );
}

return $instance;
}

/**
* Force CSS files to regenerate after the Customizer has been saved.
* This is necessary because force_file_regen_on_widget_save() doesn't fire in the Customizer for some reason.
*
* @todo Make this only happen when the widgets have been changed.
*/
public function force_file_regen_on_customizer_save() {
if ( function_exists( 'wp_use_widgets_block_editor' ) && wp_use_widgets_block_editor() ) {
update_option( 'generateblocks_dynamic_css_posts', array() );
}
}
}

GenerateBlocks_Enqueue_CSS::get_instance();
10 changes: 9 additions & 1 deletion includes/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
* @since 0.1
*/
function generateblocks_do_block_editor_assets() {
global $pagenow;

$generateblocks_deps = array( 'wp-blocks', 'wp-i18n', 'wp-editor', 'wp-element', 'wp-compose', 'wp-data' );

if ( 'widgets.php' === $pagenow ) {
unset( $generateblocks_deps[2] );
}

wp_enqueue_script(
'generateblocks',
GENERATEBLOCKS_DIR_URL . 'dist/blocks.js',
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-compose', 'wp-data' ),
$generateblocks_deps,
filemtime( GENERATEBLOCKS_DIR . 'dist/blocks.js' ),
true
);
Expand Down
Loading

0 comments on commit 72712a2

Please sign in to comment.