Objects are passed by-reference since PHP 5. In `_get_custom_object_labels()`, cast `$object->labels` back to `object` before returning. This function is weird.

Adds unit test.

Props Toro_Unit.
Fixes #33023.

Built from https://develop.svn.wordpress.org/trunk@34102


git-svn-id: http://core.svn.wordpress.org/trunk@34070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-14 01:23:26 +00:00
parent ae6a3aee7f
commit 9604c74f62
2 changed files with 3 additions and 1 deletions

View File

@ -1393,6 +1393,8 @@ function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
$defaults[$key] = $object->hierarchical ? $value[1] : $value[0]; $defaults[$key] = $object->hierarchical ? $value[1] : $value[0];
} }
$labels = array_merge( $defaults, $object->labels ); $labels = array_merge( $defaults, $object->labels );
$object->labels = (object) $object->labels;
return (object) $labels; return (object) $labels;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34101'; $wp_version = '4.4-alpha-34102';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.