#29758 closed enhancement (fixed)
Contextual Customizer Panels and Sections
Reported by: | celloexpressions | Owned by: | |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Customize | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
This is almost a bug, as most developers expect it to be present. The reason we haven't done it yet is that there is no JS API for sections or panels (which were based on sections). Now that #28709 is happening (probably in 4.1), we can complete the contextual Customizer objects API by adding support for active_callback
to panels and sections.
I have a starter patch for the PHP side of the API, essentially porting the relevant sections from WP_Customize_Control
to WP_Customize_Panel
and WP_Customize_Section
. Once #28709 happens, we can add the JS side in here as well. API-wise, contextual sections and panels should work identically to contextual controls, with the three means of adding them (note that custom panels and custom sections work, just like custom controls).
See #27993.
Attachments (2)
Change History (9)
This ticket was mentioned in IRC in #wordpress-dev by celloexpressions. View the logs.
10 years ago
#2
@
10 years ago
I've added the JS API in 29758.2.diff. Note that this patch is for the work being done on #28709, so it won't apply to trunk directly. It's all part of #28709.
This ticket was mentioned in Slack in #core by celloexpressions. View the logs.
10 years ago
#5
@
10 years ago
Looks like this works. See #29578 for implementing it in Twenty Fourteen as a bundled example.
PHP side of the API only, not yet functional. Once JS API is in place, we can build out contextuality there as well.