diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index 78abf9e857..81f3ced750 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -374,204 +374,14 @@ class WP_Customize_Section { } } -/** - * Customize Themes Section class. - * - * 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 { +/** WP_Customize_Themes_Section class */ +require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' ); - /** - * Customize section type. - * - * @since 4.2.0 - * @access public - * @var string - */ - public $type = 'themes'; +/** WP_Customize_Sidebar_Section class */ +require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' ); - /** - * 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() ) { - echo '' . __( 'Active theme' ) . ' ' . $this->title; - } else { - echo '' . __( 'Previewing theme' ) . ' ' . $this->title; - } - ?> +/** WP_Customize_Nav_Menu_Section class */ +require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' ); - -

    -
    -

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

    -

    - manager->is_theme_active() ) { - echo '' . __( 'Active theme' ) . ' ' . $this->title; - } else { - echo '' . __( 'Previewing theme' ) . ' ' . $this->title; - } - ?> - -

    - - - -
    - controls ) > 4 ) : ?> -

    - -
    -
      -
    -
    -
    -
  • -sidebar_id; - return $json; - } - - /** - * Whether the current sidebar is rendered on the page. - * - * @since 4.1.0 - * @access public - * - * @return bool Whether sidebar is rendered. - */ - public function active_callback() { - return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id ); - } -} - -/** - * Customize Menu Section Class - * - * Custom section only needed in JS. - * - * @since 4.3.0 - * - * @see WP_Customize_Section - */ -class WP_Customize_Nav_Menu_Section extends WP_Customize_Section { - - /** - * Control type. - * - * @since 4.3.0 - * @access public - * @var string - */ - public $type = 'nav_menu'; - - /** - * Get section parameters for JS. - * - * @since 4.3.0 - * @access public - * @return array Exported parameters. - */ - public function json() { - $exported = parent::json(); - $exported['menu_id'] = intval( preg_replace( '/^nav_menu\[(\d+)\]/', '$1', $this->id ) ); - - return $exported; - } -} - -/** - * Customize Menu Section Class - * - * Implements the new-menu-ui toggle button instead of a regular section. - * - * @since 4.3.0 - * - * @see WP_Customize_Section - */ -class WP_Customize_New_Menu_Section extends WP_Customize_Section { - - /** - * Control type. - * - * @since 4.3.0 - * @access public - * @var string - */ - public $type = 'new_menu'; - - /** - * Render the section, and the controls that have been added to it. - * - * @since 4.3.0 - * @access protected - */ - protected function render() { - ?> -
  • - - -
  • - id ) ); + + return $exported; + } +} diff --git a/wp-includes/customize/class-wp-customize-nav-menu-setting.php b/wp-includes/customize/class-wp-customize-nav-menu-setting.php index 4ff5831d26..766099e06b 100644 --- a/wp-includes/customize/class-wp-customize-nav-menu-setting.php +++ b/wp-includes/customize/class-wp-customize-nav-menu-setting.php @@ -1,6 +1,6 @@ +
  • + + +
  • + sidebar_id; + return $json; + } + + /** + * Whether the current sidebar is rendered on the page. + * + * @since 4.1.0 + * @access public + * + * @return bool Whether sidebar is rendered. + */ + public function active_callback() { + return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id ); + } +} diff --git a/wp-includes/customize/class-wp-customize-themes-section.php b/wp-includes/customize/class-wp-customize-themes-section.php new file mode 100644 index 0000000000..ecd7833d78 --- /dev/null +++ b/wp-includes/customize/class-wp-customize-themes-section.php @@ -0,0 +1,84 @@ +type; + ?> +
  • +

    + manager->is_theme_active() ) { + echo '' . __( 'Active theme' ) . ' ' . $this->title; + } else { + echo '' . __( 'Previewing theme' ) . ' ' . $this->title; + } + ?> + + +

    +
    +

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

    +

    + manager->is_theme_active() ) { + echo '' . __( 'Active theme' ) . ' ' . $this->title; + } else { + echo '' . __( 'Previewing theme' ) . ' ' . $this->title; + } + ?> + +

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

    + +
    +
      +
    +
    +
    +
  • +