Contextual Customizer Panels and Sections
|Reported by:||celloexpressions||Owned by:|
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).