Customizer: Extract content markup for panels to its own method, WP_Customize_Panel::render_content().

This allows to override the behavior of a panel, or even to completely replace its contents with something other than controls or sections.

props celloexpressions.
fixes #29324.

git-svn-id: https://develop.svn.wordpress.org/trunk@29950 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-10-17 21:24:32 +00:00
parent 3769ced570
commit 061226df73

View File

@ -162,7 +162,7 @@ class WP_Customize_Panel {
}
/**
* Render the panel, and the sections that have been added to it.
* Render the panel container, and then its contents.
*
* @since 4.0.0
* @access protected
@ -175,6 +175,20 @@ class WP_Customize_Panel {
<span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span>
</h3>
<ul class="accordion-sub-container control-panel-content">
<?php $this->render_content(); ?>
</ul>
</li>
<?php
}
/**
* Render the sections that have been added to the panel.
*
* @since 4.1.0
* @access protected
*/
protected function render_content() {
?>
<li class="accordion-section control-section<?php if ( empty( $this->description ) ) echo ' cannot-expand'; ?>">
<div class="accordion-section-title" tabindex="0">
<span class="preview-notice"><?php
@ -192,9 +206,5 @@ class WP_Customize_Panel {
foreach ( $this->sections as $section ) {
$section->maybe_render();
}
?>
</ul>
</li>
<?php
}
}