Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#29197 closed enhancement (fixed)

WP_Customize_Panel should not extend WP_Customize_Section

Reported by: celloexpressions's profile celloexpressions Owned by: nacin's profile nacin
Milestone: 4.0 Priority: high
Severity: normal Version: 4.0
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

Continuing on from #28979 and #27406, we need to punt this from 4.0 as it's too involved to change now. As a result, we're temporarily marking WP_Customize_Panel as final until we can implement it.

Full explanations of this are on #28979, but the gist is: Panels are not Sections (implied by the current implementation), Panels and Sections are both containers. Now that we have WP_Customize_Manager:containers() (used for mixed top-level section/panel sorting), we have containers, but not really. This change will allow us to open up WP_Customize_Panel to be extended like everything else in the Customizer can be.

Attachments (3)

28979.2.class-wp-customize-section.diff (8.9 KB) - added by celloexpressions 11 years ago.
Straight diff on class-wp-customize-section.php, which would then be renamed to class-wp-customize-container.php. Will probably need to be refreshed once we're ready to do this, and it should happen early since it'll invalidate all patches against this file.
29179.diff (8.6 KB) - added by celloexpressions 11 years ago.
Extract WP_Customize_Panel into its own class.
29179.2.diff (8.6 KB) - added by celloexpressions 11 years ago.
Add braces around if statements, per new coding standards.

Download all attachments as: .zip

Change History (9)

@celloexpressions
11 years ago

Straight diff on class-wp-customize-section.php, which would then be renamed to class-wp-customize-container.php. Will probably need to be refreshed once we're ready to do this, and it should happen early since it'll invalidate all patches against this file.

#1 @celloexpressions
11 years ago

  • Keywords 4.1-early added
  • Priority changed from normal to high

This needs to happen ASAP since we're closing off parts of the API until it happens.

#2 @celloexpressions
11 years ago

  • Keywords needs-patch added; has-patch 4.1-early removed
  • Milestone changed from Future Release to 4.0
  • Summary changed from Introduce WP_Customize_Container, and have both WP_Customize_Panel and WP_Customize_Section extend it (rather than WP_Customize_Panel extending section) to WP_Customize_Panel should not extend WP_Customize_Section

Per today's dev chat, we're going to make WP_Customize_Panel and WP_Customize_Section totally distinct, in 4.0, per nacin. While they're both UI containers, and share a few common functions, they are distinct objects and the code duplication is similar to that in WP_Customize_Control (which has stuff similar to section).

I'm working on a patch.

@celloexpressions
11 years ago

Extract WP_Customize_Panel into its own class.

This ticket was mentioned in IRC in #wordpress-dev by celloexpressions. View the logs.


11 years ago

@celloexpressions
11 years ago

Add braces around if statements, per new coding standards.

#4 @celloexpressions
11 years ago

  • Keywords has-patch added; needs-patch removed

#5 @nacin
11 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 29487:

Separate WP_Customize_Panel from WP_Customize_Section.

props celloexpressions.
fixes #29197.

#6 @nacin
11 years ago

I wouldn't mind an attempt at a new base that works for WP_Customize_Panel and WP_Customize_Section *and* WP_Customize_Control, but there's ultimately very little shared code here, especially when you also separate out the actions.

Note: See TracTickets for help on using tickets.