Skip to content

Commit

Permalink
Only dequeue jw-cmb2-rgba-picker-js script (and enqueue our `wp-col…
Browse files Browse the repository at this point in the history
…or-picker-alpha`) if it is actually found
  • Loading branch information
jtsternberg committed Nov 27, 2017
1 parent 4e2f900 commit b1a7e8f
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 124 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
### Bug Fixes

* Fix another issue (introduced in 2.2.6) with repeatable fields not being able to save additional fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#1059](https://github.com/CMB2/CMB2/pull/1059), [#1058](https://github.com/CMB2/CMB2/issues/1058)).
* Only dequeue `jw-cmb2-rgba-picker-js` script (and enqueue our `wp-color-picker-alpha`) if it is actually found.

## [2.2.6.1 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.1)

Expand Down
6 changes: 4 additions & 2 deletions includes/types/CMB2_Type_Colorpicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ public function render() {
}

public static function dequeue_rgba_colorpicker_script() {
wp_dequeue_script( 'jw-cmb2-rgba-picker-js' );
CMB2_JS::register_colorpicker_alpha( true );
if ( wp_script_is( 'jw-cmb2-rgba-picker-js', 'enqueued' ) ) {
wp_dequeue_script( 'jw-cmb2-rgba-picker-js' );
CMB2_JS::register_colorpicker_alpha( true );
}
}

}
Loading

0 comments on commit b1a7e8f

Please sign in to comment.