Changeset 63488 for trunk/src/wp-includes/post.php
- Timestamp:
- 09/05/2026 01:39:01 AM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r63442 r63488 4453 4453 * @param array $args Optional. Category query parameters. Default empty array. 4454 4454 * See WP_Term_Query::__construct() for supported arguments. 4455 * @return array|WP_Error List of categories. If the `$fields` argument passed via `$args` is 'all' or 4456 * 'all_with_object_id', an array of WP_Term objects will be returned. If `$fields` 4457 * is 'ids', an array of category IDs. If `$fields` is 'names', an array of category names. 4458 * WP_Error object if 'category' taxonomy doesn't exist. 4455 * @return int[]|WP_Term[]|string[]|string|WP_Error List of categories. An array of category IDs by 4456 * default, and if the `$fields` argument passed via 4457 * `$args` is 'ids'. If `$fields` is 'all' or 4458 * 'all_with_object_id', an array of WP_Term objects. 4459 * If `$fields` is 'names', an array of category names. 4460 * If `$fields` is 'count', a count thereof as a numeric 4461 * string. WP_Error object if 'category' taxonomy 4462 * doesn't exist. 4463 * 4464 * @phpstan-return ( 4465 * $args is array{ fields: 'count', ... } 4466 * ? numeric-string|WP_Error 4467 * : ( $args is array{ fields: 'id=>parent', ... } 4468 * ? array<int, int>|WP_Error 4469 * : ( $args is array{ fields: 'names'|'slugs', ... } 4470 * ? string[]|WP_Error 4471 * : ( $args is array{ fields: 'id=>name'|'id=>slug', ... } 4472 * ? array<int, string>|WP_Error 4473 * : ( $args is array{ fields: 'all'|'all_with_object_id', ... } 4474 * ? WP_Term[]|WP_Error 4475 * : int[]|WP_Error ) ) ) ) 4476 * ) 4459 4477 */ 4460 4478 function wp_get_post_categories( $post_id = 0, $args = array() ) { … … 4481 4499 * @param array $args Optional. Tag query parameters. Default empty array. 4482 4500 * See WP_Term_Query::__construct() for supported arguments. 4483 * @return array|WP_Error Array of WP_Term objects on success or empty array if no tags were found. 4484 * WP_Error object if 'post_tag' taxonomy doesn't exist. 4501 * @return WP_Term[]|int[]|string[]|string|WP_Error Array of WP_Term objects on success or empty array if no 4502 * tags were found. A count thereof as a numeric string if 4503 * the `$fields` argument passed via `$args` is 'count'. 4504 * WP_Error object if 'post_tag' taxonomy doesn't exist. 4505 * 4506 * @phpstan-return ( 4507 * $args is array{ fields: 'count', ... } 4508 * ? numeric-string|WP_Error 4509 * : ( $args is array{ fields: 'ids'|'tt_ids', ... } 4510 * ? int[]|WP_Error 4511 * : ( $args is array{ fields: 'id=>parent', ... } 4512 * ? array<int, int>|WP_Error 4513 * : ( $args is array{ fields: 'names'|'slugs', ... } 4514 * ? string[]|WP_Error 4515 * : ( $args is array{ fields: 'id=>name'|'id=>slug', ... } 4516 * ? array<int, string>|WP_Error 4517 * : WP_Term[]|WP_Error ) ) ) ) 4518 * ) 4485 4519 */ 4486 4520 function wp_get_post_tags( $post_id = 0, $args = array() ) { … … 4502 4536 * @type string $fields Term fields to retrieve. Default 'all'. 4503 4537 * } 4504 * @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found. 4505 * WP_Error object if `$taxonomy` doesn't exist. 4538 * @return WP_Term[]|int[]|string[]|string|WP_Error Array of WP_Term objects on success or empty array if no 4539 * terms were found. A count thereof as a numeric string if 4540 * the `$fields` argument passed via `$args` is 'count'. 4541 * WP_Error object if `$taxonomy` doesn't exist. 4542 * 4543 * @phpstan-return ( 4544 * $args is array{ fields: 'count', ... } 4545 * ? numeric-string|WP_Error 4546 * : ( $args is array{ fields: 'ids'|'tt_ids', ... } 4547 * ? int[]|WP_Error 4548 * : ( $args is array{ fields: 'id=>parent', ... } 4549 * ? array<int, int>|WP_Error 4550 * : ( $args is array{ fields: 'names'|'slugs', ... } 4551 * ? string[]|WP_Error 4552 * : ( $args is array{ fields: 'id=>name'|'id=>slug', ... } 4553 * ? array<int, string>|WP_Error 4554 * : WP_Term[]|WP_Error ) ) ) ) 4555 * ) 4506 4556 */ 4507 4557 function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)