Docs: Improve `@param` and `@return` entries for `wp_get_post_categories()`, `wp_get_post_tags()`, and `wp_get_post_terms()`.
Props philipjohn, theMikeD. Fixes #40481. Built from https://develop.svn.wordpress.org/trunk@40483 git-svn-id: http://core.svn.wordpress.org/trunk@40359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c0399b4fde
commit
35987df4e4
|
@ -2800,10 +2800,12 @@ function wp_untrash_post_comments( $post = null ) {
|
|||
*
|
||||
* @param int $post_id Optional. The Post ID. Does not default to the ID of the
|
||||
* global $post. Default 0.
|
||||
* @param array $args Optional. Category arguments. See wp_get_object_terms(). Default empty.
|
||||
* @return array List of categories. If the `$fields` argument passed via `$args` is 'all' or
|
||||
* 'all_with_object_id', an array of WP_Term objects will be returned. If `$fields`
|
||||
* is 'ids', an array of category ids. If `$fields` is 'names', an array of category names.
|
||||
* @param array $args Optional. Category query parameters. Default empty array.
|
||||
* See WP_Term_Query::__construct() for supported arguments.
|
||||
* @return array|WP_Error List of categories. If the `$fields` argument passed via `$args` is 'all' or
|
||||
* 'all_with_object_id', an array of WP_Term objects will be returned. If `$fields`
|
||||
* is 'ids', an array of category ids. If `$fields` is 'names', an array of category names.
|
||||
* WP_Error object if 'category' taxonomy doesn't exist.
|
||||
*/
|
||||
function wp_get_post_categories( $post_id = 0, $args = array() ) {
|
||||
$post_id = (int) $post_id;
|
||||
|
@ -2826,8 +2828,10 @@ function wp_get_post_categories( $post_id = 0, $args = array() ) {
|
|||
*
|
||||
* @param int $post_id Optional. The Post ID. Does not default to the ID of the
|
||||
* global $post. Default 0.
|
||||
* @param array $args Optional. Overwrite the defaults
|
||||
* @return array List of post tags.
|
||||
* @param array $args Optional. Tag query parameters. Default empty array.
|
||||
* See WP_Term_Query::__construct() for supported arguments.
|
||||
* @return array|WP_Error Array of WP_Term objects on success or empty array if no tags were found.
|
||||
* WP_Error object if 'post_tag' taxonomy doesn't exist.
|
||||
*/
|
||||
function wp_get_post_tags( $post_id = 0, $args = array() ) {
|
||||
return wp_get_post_terms( $post_id, 'post_tag', $args);
|
||||
|
@ -2845,9 +2849,10 @@ function wp_get_post_tags( $post_id = 0, $args = array() ) {
|
|||
* @param int $post_id Optional. The Post ID. Does not default to the ID of the
|
||||
* global $post. Default 0.
|
||||
* @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
|
||||
* @param array $args Optional. wp_get_object_terms() arguments. Default empty array.
|
||||
* @return array|WP_Error List of post terms or empty array if no terms were found. WP_Error object
|
||||
* if `$taxonomy` doesn't exist.
|
||||
* @param array $args Optional. Term query parameters. Default empty array.
|
||||
* See WP_Term_Query::__construct() for supported arguments.
|
||||
* @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found.
|
||||
* WP_Error object if `$taxonomy` doesn't exist.
|
||||
*/
|
||||
function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
|
||||
$post_id = (int) $post_id;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-alpha-40481';
|
||||
$wp_version = '4.8-alpha-40483';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue