From f64a6a8da7f7404a7bc29257c8385fbcd7197755 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 18 Nov 2019 07:57:47 +0000 Subject: [PATCH] Taxonomy: Correct the initial value for `WP_Taxonomy::$labels` to match `get_taxonomy_labels()` return type. Improve documentation for consistency with `WP_Post_Type::$labels`. Props alpipego. Fixes #48681. git-svn-id: https://develop.svn.wordpress.org/trunk@46743 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-taxonomy.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-taxonomy.php b/src/wp-includes/class-wp-taxonomy.php index 716da8d384..24cc10187e 100644 --- a/src/wp-includes/class-wp-taxonomy.php +++ b/src/wp-includes/class-wp-taxonomy.php @@ -30,12 +30,17 @@ final class WP_Taxonomy { public $label; /** - * An array of labels for this taxonomy. + * Labels object for this taxonomy. + * + * If not set, tag labels are inherited for non-hierarchical types + * and category labels for hierarchical ones. + * + * @see get_taxonomy_labels() * * @since 4.7.0 * @var object */ - public $labels = array(); + public $labels; /** * A short descriptive summary of what the taxonomy is for.