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. git-svn-id: https://develop.svn.wordpress.org/trunk@40483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2c50a6dd24
commit
ff25986f02
@ -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
|
||||
* @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;
|
||||
|
Loading…
Reference in New Issue
Block a user