From ae4cf7665a46c3b6fb6b538d0526ae05e3cd82c0 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 21 Sep 2013 17:44:09 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@25553 git-svn-id: http://core.svn.wordpress.org/trunk@25473 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 3 +++ wp-includes/taxonomy.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index ddd73bc737..81b5d76c44 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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; diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 8e1898e29f..acb8517ce7 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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;