Make WordPress Core

Opened 11 hours ago

Last modified 9 hours ago

#65796 new defect (bug)

The Customizer doesn't use the admin_body_class filter

Reported by: afercia Owned by:
Priority: normal Milestone: Awaiting Review
Component: Customize Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The Customizer doesn't make use of the admin_body_class filter. I would expect all admin pages to use it.

Rationale: plugins may want to add their own CSS classes for their own purposes.

Actually, while developing a small plugin, I had to resort to the customize_controls_head action hook and add my CSS class via JavaScript. It is a workaround but it's not ideal.

Wondering if there is any specific reason why the Customizer doesn't use the admin_body_class filter.

Change History (3)

This ticket was mentioned in PR #12815 on WordPress/wordpress-develop by @afercia.


11 hours ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/65796#ticket

## Use of AI Tools

None

@mukesh27 commented on PR #12815:


9 hours ago
#2

Tested well!

The custom class my_custom_class appears correctly after pulling the changes from this PR.

### Before:
https://github.com/user-attachments/assets/e03fb738-379d-4317-8df1-5f274b25c8ae

### After:
https://github.com/user-attachments/assets/3ca53dd9-1163-4e2b-8653-c7e1ac359094

@afercia commented on PR #12815:


9 hours ago
#3

Thanks for your review @mukeshpanchal27 I would like to hear from @westonruter if there's any reason to not do this we may be missing.

Note: See TracTickets for help on using tickets.