web/wp-includes/class-wp-customize-section.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
     1 <?php
     1 <?php
     2 /**
     2 /**
     3  * Customize Section Class
     3  * Customize Section Class.
     4  *
     4  *
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Customize
     6  * @subpackage Customize
     7  * @since 3.4.0
     7  * @since 3.4.0
     8  */
     8  */
     9 
       
    10 class WP_Customize_Section {
     9 class WP_Customize_Section {
    11 	public $manager;
    10 	public $manager;
    12 	public $id;
    11 	public $id;
    13 	public $priority       = 10;
    12 	public $priority       = 10;
    14 	public $capability     = 'edit_theme_options';
    13 	public $capability     = 'edit_theme_options';
    20 	/**
    19 	/**
    21 	 * Constructor.
    20 	 * Constructor.
    22 	 *
    21 	 *
    23 	 * @since 3.4.0
    22 	 * @since 3.4.0
    24 	 *
    23 	 *
       
    24 	 * @param WP_Customize_Manager $manager
    25 	 * @param string $id An specific ID of the section.
    25 	 * @param string $id An specific ID of the section.
    26 	 * @param array $args Section arguments.
    26 	 * @param array $args Section arguments.
    27 	 */
    27 	 */
    28 	function __construct( $manager, $id, $args = array() ) {
    28 	function __construct( $manager, $id, $args = array() ) {
    29 		$keys = array_keys( get_class_vars( __CLASS__ ) );
    29 		$keys = array_keys( get_class_vars( __CLASS__ ) );
    70 		do_action( 'customize_render_section_' . $this->id );
    70 		do_action( 'customize_render_section_' . $this->id );
    71 
    71 
    72 		$this->render();
    72 		$this->render();
    73 	}
    73 	}
    74 
    74 
    75 
       
    76 	/**
    75 	/**
    77 	 * Render the section.
    76 	 * Render the section.
    78 	 *
    77 	 *
    79 	 * @since 3.4.0
    78 	 * @since 3.4.0
    80 	 */
    79 	 */
    81 	protected function render() {
    80 	protected function render() {
    82 		?>
    81 		?>
    83 		<li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section">
    82 		<li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section">
    84 			<h3 class="customize-section-title" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>
    83 			<h3 class="customize-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>
    85 			<ul class="customize-section-content">
    84 			<ul class="customize-section-content">
    86 				<?php
    85 				<?php
    87 				foreach ( $this->controls as $control )
    86 				foreach ( $this->controls as $control )
    88 					$control->maybe_render();
    87 					$control->maybe_render();
    89 				?>
    88 				?>