diff --git a/src/wp-includes/rest-api/class-wp-rest-request.php b/src/wp-includes/rest-api/class-wp-rest-request.php
index 26c1c0fb45..a4fb9c72d2 100644
a
|
b
|
class WP_REST_Request implements ArrayAccess { |
380 | 380 | * @since 4.4.0 |
381 | 381 | * |
382 | 382 | * @param string $key Parameter name. |
| 383 | * @param mixed $default Optional. Default value to return if the key does not exist. |
383 | 384 | * @return mixed|null Value if set, null otherwise. |
384 | 385 | */ |
385 | | public function get_param( $key ) { |
| 386 | public function get_param( $key, $default = null ) { |
386 | 387 | $order = $this->get_parameter_order(); |
387 | 388 | |
388 | 389 | foreach ( $order as $type ) { |
… |
… |
class WP_REST_Request implements ArrayAccess { |
392 | 393 | } |
393 | 394 | } |
394 | 395 | |
395 | | return null; |
| 396 | return $default; |
396 | 397 | } |
397 | 398 | |
398 | 399 | /** |