Skip to content

Commit

Permalink
do not declare dependence on wp-blocks or wp-editor unless it's a Gut…
Browse files Browse the repository at this point in the history
…enberg page
  • Loading branch information
mlwilkerson committed Aug 27, 2021
1 parent 9d37653 commit fe16c9e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/class-fontawesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,14 @@ private function enqueue_admin_js_assets( $with_icon_chooser ) {
} else {
$deps = array_merge( $deps, array( 'react', 'react-dom', 'wp-i18n', 'wp-element', 'wp-components', 'wp-api-fetch' ) );

if ( $enable_icon_chooser ) {
/**
* We don't need these Gutenberg dependencies unless we're on a Gutenberg
* page. Declaring them unnecessarily (when not on a Gutenberg page)
* has resulted in conflict for at least one other plugin: RankMath.
*
* See: https://wordpress.org/support/topic/plugin-conflicts-with-rankmath
*/
if ( $enable_icon_chooser && $this->is_gutenberg_page() ) {
$deps = array_merge( $deps, array( 'wp-blocks', 'wp-editor' ) );
}
}
Expand Down

0 comments on commit fe16c9e

Please sign in to comment.