|
@@ 236-249 (lines=14) @@
|
| 233 |
|
*/ |
| 234 |
|
public function __construct( $args = array() ) { |
| 235 |
|
|
| 236 |
|
foreach ( $this->deprecated_args as $arg => $data ) { |
| 237 |
|
if ( isset( $args[ $arg ] ) ) { |
| 238 |
|
|
| 239 |
|
_deprecated_argument( |
| 240 |
|
esc_html( "{$data['class']}::__construct" ) |
| 241 |
|
, esc_html( $data['version'] ) |
| 242 |
|
, esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" ) |
| 243 |
|
); |
| 244 |
|
|
| 245 |
|
$args[ $data['replacement'] ] = $args[ $arg ]; |
| 246 |
|
|
| 247 |
|
unset( $args[ $arg ] ); |
| 248 |
|
} |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
$this->args = array_merge( $this->defaults, $args ); |
| 252 |
|
} |
|
@@ 297-310 (lines=14) @@
|
| 294 |
|
*/ |
| 295 |
|
public function set_args( array $args ) { |
| 296 |
|
|
| 297 |
|
foreach ( $this->deprecated_args as $arg => $data ) { |
| 298 |
|
if ( isset( $args[ $arg ] ) ) { |
| 299 |
|
|
| 300 |
|
_deprecated_argument( |
| 301 |
|
esc_html( "{$data['class']}::set_args" ) |
| 302 |
|
, esc_html( $data['version'] ) |
| 303 |
|
, esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" ) |
| 304 |
|
); |
| 305 |
|
|
| 306 |
|
$args[ $data['replacement'] ] = $args[ $arg ]; |
| 307 |
|
|
| 308 |
|
unset( $args[ $arg ] ); |
| 309 |
|
} |
| 310 |
|
} |
| 311 |
|
|
| 312 |
|
$this->args = array_merge( $this->args, $args ); |
| 313 |
|
|