From d36e2dd621c81c4ea445020b9587d3323664af9c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 16 Oct 2021 02:37:39 +0000 Subject: [PATCH] Docs: Improve documentation for the `tax_input` parameter of `wp_insert_post()`. Follow-up to [10222], [13217], [33922]. Props dingo_d. Fixes #54264. git-svn-id: https://develop.svn.wordpress.org/trunk@51913 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 7073328c0d..fb90f626f4 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3823,7 +3823,14 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) { * @type int[] $post_category Array of category IDs. * Defaults to value of the 'default_category' option. * @type array $tags_input Array of tag names, slugs, or IDs. Default empty. - * @type array $tax_input Array of taxonomy terms keyed by their taxonomy name. Default empty. + * @type array $tax_input An array of taxonomy terms keyed by their taxonomy name. + * If the taxonomy is hierarchical, the term list needs to be + * either an array of term IDs or a comma-separated string of IDs. + * If the taxonomy is non-hierarchical, the term list can be an array + * that contains term names or slugs, or a comma-separated string + * of names or slugs. This is because, in hierarchical taxonomy, + * child terms can have the same names with different parent terms, + * so the only way to connect them is using ID. Default empty. * @type array $meta_input Array of post meta values keyed by their post meta key. Default empty. * } * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false.