Skip to content

Commit

Permalink
resolves buttons.css gets lost on update to WP 6.6 #131
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesros161 committed Sep 3, 2024
1 parent 6a16d6d commit b5dc3fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This version changes the way the color palette CSS is generated. If you are usin

== 2.22.5 ==
* Update: Updated WooCommerce templates [#132](https://github.com/BoldGrid/crio/issues/132)
* Bug Fix: buttons.css gets lost on update to WP 6.6 [#131](https://github.com/BoldGrid/crio/issues/131)

== 2.22.4 ==
* Update: Updated WooCommerce templates [#127](https://github.com/BoldGrid/crio/issues/127)
Expand Down
10 changes: 9 additions & 1 deletion src/includes/class-boldgrid-framework-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,19 @@ public function get_local_editor_styles() {
public function enqueue_buttons( $deps = array() ) {
$button_configs = $this->configs['components']['buttons'];

/*
* For unknown reasons, sometimes the buttons.css file gets deleted.
* This will force rebuilding the buttons.css file if it doesn't exist.
*/
if ( true === $button_configs['enabled'] && ! file_exists( $button_configs['css_file'] ) ) {
$compile = new Boldgrid_Framework_Scss_Compile( $this->configs );
$compile->build_bgtfw();
}

if ( true === $button_configs['enabled'] && file_exists( $button_configs['css_file'] ) ) {
$last_mod = filemtime( $button_configs['css_file'] );
wp_enqueue_style( 'boldgrid-buttons', $button_configs['css_uri'], $deps, $last_mod );
}

}

/**
Expand Down

0 comments on commit b5dc3fa

Please sign in to comment.