| @@ 171-188 (lines=18) @@ | ||
| 168 | * @param string $id An specific ID of the section. |
|
| 169 | * @param array $args Section arguments. |
|
| 170 | */ |
|
| 171 | public function __construct( $manager, $id, $args = array() ) { |
|
| 172 | $keys = array_keys( get_object_vars( $this ) ); |
|
| 173 | foreach ( $keys as $key ) { |
|
| 174 | if ( isset( $args[ $key ] ) ) { |
|
| 175 | $this->$key = $args[ $key ]; |
|
| 176 | } |
|
| 177 | } |
|
| 178 | ||
| 179 | $this->manager = $manager; |
|
| 180 | $this->id = $id; |
|
| 181 | if ( empty( $this->active_callback ) ) { |
|
| 182 | $this->active_callback = array( $this, 'active_callback' ); |
|
| 183 | } |
|
| 184 | self::$instance_count += 1; |
|
| 185 | $this->instance_number = self::$instance_count; |
|
| 186 | ||
| 187 | $this->controls = array(); // Users cannot customize the $controls array. |
|
| 188 | } |
|
| 189 | ||
| 190 | /** |
|
| 191 | * Check whether section is active to current Customizer preview. |
|
| @@ 159-176 (lines=18) @@ | ||
| 156 | * @param string $id An specific ID for the panel. |
|
| 157 | * @param array $args Panel arguments. |
|
| 158 | */ |
|
| 159 | public function __construct( $manager, $id, $args = array() ) { |
|
| 160 | $keys = array_keys( get_object_vars( $this ) ); |
|
| 161 | foreach ( $keys as $key ) { |
|
| 162 | if ( isset( $args[ $key ] ) ) { |
|
| 163 | $this->$key = $args[ $key ]; |
|
| 164 | } |
|
| 165 | } |
|
| 166 | ||
| 167 | $this->manager = $manager; |
|
| 168 | $this->id = $id; |
|
| 169 | if ( empty( $this->active_callback ) ) { |
|
| 170 | $this->active_callback = array( $this, 'active_callback' ); |
|
| 171 | } |
|
| 172 | self::$instance_count += 1; |
|
| 173 | $this->instance_number = self::$instance_count; |
|
| 174 | ||
| 175 | $this->sections = array(); // Users cannot customize the $sections array. |
|
| 176 | } |
|
| 177 | ||
| 178 | /** |
|
| 179 | * Check whether panel is active to current Customizer preview. |
|