Skip to content

fix: prevent wp-edit-post from loading in the customizer block widgets editor - #2667

Open
faisalahammad wants to merge 1 commit into
godaddy-wordpress:masterfrom
faisalahammad:fix/2627-wp-edit-post-customize
Open

fix: prevent wp-edit-post from loading in the customizer block widgets editor#2667
faisalahammad wants to merge 1 commit into
godaddy-wordpress:masterfrom
faisalahammad:fix/2627-wp-edit-post-customize

Conversation

@faisalahammad

Copy link
Copy Markdown

Description

This fix extends the existing pagenow check for widgets.php to also cover customize.php. CoBlocks was loading the wp-edit-post script dependency in the customizer, causing a JS conflict with themes like Blocksy when WooCommerce is also active.

The editor_assets() method already strips wp-edit-post and wp-editor from script dependencies on widgets.php, but the customizer was not included in that check.

Fixes #2627

Screenshots

N/A

Types of changes

Bug fix (non-breaking change which fixes an issue)

How has this been tested?

  • Code review confirmed the fix mirrors the existing widgets.php pattern exactly.
  • PHP syntax check passed on both modified files.
  • CodeRabbit review passed (0 findings).
  • New PHPUnit test test_wp_edit_post_stripped_on_customize_php verifies wp-edit-post and wp-editor are stripped when $pagenow is customize.php.

Acceptance criteria

  • CoBlocks loads without wp-edit-post dependency in Appearance > Customize block widgets editor.
  • Post editor and Appearance > Widgets screens remain unaffected.

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

…s editor

- Extend existing widgets.php dependency guards to also cover
  customize.php, preventing JS conflicts with themes like Blocksy
  in the Appearance > Customize block widgets editor.
- Add PHPUnit test to verify wp-edit-post and wp-editor are stripped
  from script dependencies when $pagenow is customize.php.

Fixes godaddy-wordpress#2627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp-edit-post dependency loaded in the customizer

1 participant