Skip to content

Commit

Permalink
Merge pull request #531 from humanmade/enqueued-script-warning
Browse files Browse the repository at this point in the history
Enqueued script warning for wp-editor on widgets screen
  • Loading branch information
Robin Devitt authored Feb 23, 2022
2 parents 4008686 + 0113ebf commit f5918e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/branding/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ function remove_howdy_greeting( WP_Admin_Bar $wp_admin_bar ) {
* Enqueue branding script for the post previews.
*/
function enqueue_block_editor_branding_assets() {
global $pagenow;

// Return early when viewing the customizer or widgets screen.
if ( is_customize_preview() || 'widgets.php' === $pagenow ) {
return;
}

wp_enqueue_script(
'altis-branding',
plugin_dir_url( dirname( __FILE__, 2 ) ) . 'assets/branding.js',
Expand Down

0 comments on commit f5918e4

Please sign in to comment.