X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..46588ee871246a923d972538dbc93b26f4fda932:/wp-includes/class-wp-customize-section.php diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index b033203e..b852dfba 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -1,13 +1,21 @@ instance_number = self::$instance_count; $this->controls = array(); // Users cannot customize the $controls array. - - return $this; } /** @@ -175,7 +181,7 @@ class WP_Customize_Section { * * @return bool Whether the section is active to the current preview. */ - public final function active() { + final public function active() { $section = $this; $active = call_user_func( $this->active_callback, $this ); @@ -230,7 +236,7 @@ class WP_Customize_Section { * * @return bool False if theme doesn't support the section or user doesn't have the capability. */ - public final function check_capabilities() { + final public function check_capabilities() { if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { return false; } @@ -249,7 +255,7 @@ class WP_Customize_Section { * * @return string Contents of the section. */ - public final function get_content() { + final public function get_content() { ob_start(); $this->maybe_render(); $template = trim( ob_get_contents() ); @@ -262,7 +268,7 @@ class WP_Customize_Section { * * @since 3.4.0 */ - public final function maybe_render() { + final public function maybe_render() { if ( ! $this->check_capabilities() ) { return; } @@ -314,10 +320,87 @@ class WP_Customize_Section { } /** - * Customizer section representing widget area (sidebar). + * Customize Themes Section class. * - * @package WordPress - * @subpackage Customize + * A UI container for theme controls, which behaves like a backwards Panel. + * + * @since 4.2.0 + * + * @see WP_Customize_Section + */ +class WP_Customize_Themes_Section extends WP_Customize_Section { + + /** + * Customize section type. + * + * @since 4.2.0 + * @access public + * @var string + */ + public $type = 'themes'; + + /** + * Render the themes section, which behaves like a panel. + * + * @since 4.2.0 + * @access protected + */ + protected function render() { + $classes = 'accordion-section control-section control-section-' . $this->type; + ?> +
  • +

    + manager->is_theme_active() ) { + /* translators: %s: theme name */ + printf( __( 'Active theme %s' ), $this->title ); + } else { + /* translators: %s: theme name */ + printf( __( 'Previewing theme %s' ), $this->title ); + } + ?> + + +

    +
    +

    + + controls ) + 1 /* Active theme */; ?> +

    + +

    + manager->is_theme_active() ) { + /* translators: %s: theme name */ + printf( __( 'Active theme %s' ), $this->title ); + } else { + /* translators: %s: theme name */ + printf( __( 'Previewing theme %s' ), $this->title ); + } + ?> + +

    + + + +
    + controls ) > 4 ) : ?> +

    + +
    +
      +
    +
    +
    +
  • +