Changeset 20248 for trunk/wp-includes/class-wp-customize-section.php
- Timestamp:
- 03/21/2012 10:55:43 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-customize-section.php
r20232 r20248 9 9 10 10 class WP_Customize_Section { 11 public $manager; 11 12 public $id; 12 13 public $priority = 10; … … 25 26 * @param array $args Section arguments. 26 27 */ 27 function __construct( $id, $args = array() ) { 28 $this->id = $id; 29 28 function __construct( $manager, $id, $args = array() ) { 30 29 $keys = array_keys( get_class_vars( __CLASS__ ) ); 31 30 foreach ( $keys as $key ) { … … 33 32 $this->$key = $args[ $key ]; 34 33 } 34 35 $this->manager = $manager; 36 $this->id = $id; 35 37 36 38 $this->settings = array(); // Users cannot customize the $settings array. … … 46 48 * @return bool False if theme doesn't support the section or user doesn't have the capability. 47 49 */ 48 function check_capabilities() {50 public final function check_capabilities() { 49 51 if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) 50 52 return false; … … 57 59 58 60 /** 61 * Check capabiliites and render the section. 62 * 63 * @since 3.4.0 64 */ 65 public final function maybe_render() { 66 if ( ! $this->check_capabilities() ) 67 return; 68 69 do_action( 'customize_render_section', $this ); 70 do_action( 'customize_render_section_' . $this->id ); 71 72 $this->render(); 73 } 74 75 76 /** 59 77 * Render the section. 60 78 * 61 79 * @since 3.4.0 62 80 */ 63 function render() { 64 if ( ! $this->check_capabilities() ) 65 return; 81 protected function render() { 66 82 ?> 67 83 <li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section"> … … 70 86 <?php foreach ( $this->settings as $setting ) : ?> 71 87 <li id="customize-control-<?php echo esc_attr( $setting->id ); ?>" class="customize-control customize-control-<?php echo esc_attr( $setting->control ); ?>"> 72 <?php $setting-> _render(); ?>88 <?php $setting->maybe_render(); ?> 73 89 </li> 74 90 <?php endforeach; ?>
Note: See TracChangeset
for help on using the changeset viewer.