Add `@access private` to `_get_custom_object_labels()`, which was already implied by the dangling underscore. Cast `$labels` to `array` in `get_taxonomy_labels()` and `_get_custom_object_labels()`.

Props nacin, foofy.
Fixes #16310.



git-svn-id: https://develop.svn.wordpress.org/trunk@25553 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2013-09-21 17:43:14 +00:00
parent 7cca3e427b
commit 0d6c7bbbc3
2 changed files with 5 additions and 0 deletions

View File

@ -1473,6 +1473,8 @@ function _post_type_meta_capabilities( $capabilities = null ) {
* Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).
*
* @since 3.0.0
* @access private
*
* @param object $post_type_object
* @return object object with all the labels as member variables
*/
@ -1506,6 +1508,7 @@ function get_post_type_labels( $post_type_object ) {
* @since 3.0.0
*/
function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
$object->labels = (array) $object->labels;
if ( isset( $object->label ) && empty( $object->labels['name'] ) )
$object->labels['name'] = $object->label;

View File

@ -438,6 +438,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
*/
function get_taxonomy_labels( $tax ) {
$tax->labels = (array) $tax->labels;
if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) )
$tax->labels['separate_items_with_commas'] = $tax->helps;