| @@ 150-167 (lines=18) @@ | ||
| 147 | * @param string $id An specific ID for the panel. |
|
| 148 | * @param array $args Panel arguments. |
|
| 149 | */ |
|
| 150 | public function __construct( $manager, $id, $args = array() ) { |
|
| 151 | $keys = array_keys( get_object_vars( $this ) ); |
|
| 152 | foreach ( $keys as $key ) { |
|
| 153 | if ( isset( $args[ $key ] ) ) { |
|
| 154 | $this->$key = $args[ $key ]; |
|
| 155 | } |
|
| 156 | } |
|
| 157 | ||
| 158 | $this->manager = $manager; |
|
| 159 | $this->id = $id; |
|
| 160 | if ( empty( $this->active_callback ) ) { |
|
| 161 | $this->active_callback = array( $this, 'active_callback' ); |
|
| 162 | } |
|
| 163 | self::$instance_count += 1; |
|
| 164 | $this->instance_number = self::$instance_count; |
|
| 165 | ||
| 166 | $this->sections = array(); // Users cannot customize the $sections array. |
|
| 167 | } |
|
| 168 | ||
| 169 | /** |
|
| 170 | * Check whether panel is active to current Customizer preview. |
|
| @@ 159-176 (lines=18) @@ | ||
| 156 | * @param string $id An specific ID of the section. |
|
| 157 | * @param array $args Section 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->controls = array(); // Users cannot customize the $controls array. |
|
| 176 | } |
|
| 177 | ||
| 178 | /** |
|
| 179 | * Check whether section is active to current Customizer preview. |
|