General: Correct the default value of the $defaults parameter in wp_parse_args() to match the documented type.

Props subrataemfluence.
See #45643.
Built from https://develop.svn.wordpress.org/trunk@47429


git-svn-id: http://core.svn.wordpress.org/trunk@47216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-03-04 12:00:06 +00:00
parent 4a00ea1127
commit eea1fd30c2
2 changed files with 5 additions and 4 deletions

View File

@ -4349,10 +4349,11 @@ function smilies_init() {
* @since 2.3.0 `$args` can now also be an object.
*
* @param string|array|object $args Value to merge with $defaults.
* @param array $defaults Optional. Array that serves as the defaults. Default empty.
* @param array $defaults Optional. Array that serves as the defaults.
* Default empty array.
* @return array Merged user defined values with defaults.
*/
function wp_parse_args( $args, $defaults = '' ) {
function wp_parse_args( $args, $defaults = array() ) {
if ( is_object( $args ) ) {
$parsed_args = get_object_vars( $args );
} elseif ( is_array( $args ) ) {
@ -4361,7 +4362,7 @@ function wp_parse_args( $args, $defaults = '' ) {
wp_parse_str( $args, $parsed_args );
}
if ( is_array( $defaults ) ) {
if ( is_array( $defaults ) && $defaults ) {
return array_merge( $defaults, $parsed_args );
}
return $parsed_args;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47428';
$wp_version = '5.5-alpha-47429';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.