WordPress.org

Make WordPress Core

Changeset 45915


Ignore:
Timestamp:
08/30/2019 11:34:11 AM (3 weeks ago)
Author:
johnbillion
Message:

Docs: Correct and improve inline docs relating to caching, terms, meta, and some misc tweaks.

See #47110

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r45739 r45915  
    419419 * @param string $desc       Optional. Description of the side-loaded file. Default null.
    420420 * @param array  $post_data  Optional. Post data to override. Default empty array.
    421  * @return int|object The ID of the attachment or a WP_Error on failure.
     421 * @return int|WP_Error The ID of the attachment or a WP_Error on failure.
    422422 */
    423423function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data = array() ) {
  • trunk/src/wp-includes/class-wp-user-query.php

    r45590 r45915  
    180180     *                                             conjunction with pagination. Value -1 (all) is supported, but
    181181     *                                             should be used with caution on larger sites.
    182      *                                             Default empty (all users).
     182     *                                             Default -1 (all users).
    183183     *     @type int          $paged               When used with number, defines the page of results to return.
    184184     *                                             Default 1.
  • trunk/src/wp-includes/meta.php

    r45786 r45915  
    878878 * @global wpdb $wpdb WordPress database abstraction object.
    879879 *
    880  * @param string    $meta_type  Type of object metadata is for (e.g., comment, post, term, or user).
    881  * @param int|array $object_ids Array or comma delimited list of object IDs to update cache for
     880 * @param string       $meta_type  Type of object metadata is for (e.g., comment, post, term, or user).
     881 * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for.
    882882 * @return array|false Metadata cache for the specified objects, or false on failure.
    883883 */
     
    913913     *
    914914     * @param mixed $check      Whether to allow updating the meta cache of the given type.
    915      * @param array $object_ids Array of object IDs to update the meta cache for.
     915     * @param int[] $object_ids Array of object IDs to update the meta cache for.
    916916     */
    917917    $check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
  • trunk/src/wp-includes/post.php

    r45851 r45915  
    12671267 *     @type bool        $show_ui               Whether to generate and allow a UI for managing this post type in the
    12681268 *                                              admin. Default is value of $public.
    1269  *     @type bool        $show_in_menu          Where to show the post type in the admin menu. To work, $show_ui
     1269 *     @type bool|string $show_in_menu          Where to show the post type in the admin menu. To work, $show_ui
    12701270 *                                              must be true. If true, the post type is shown in its own top level
    12711271 *                                              menu. If false, no menu is shown. If a string of an existing top
     
    64176417 * @since 1.5.1
    64186418 *
    6419  * @param array $posts Array of post objects (passed by reference).
     6419 * @param WP_Post[] $posts Array of post objects (passed by reference).
    64206420 */
    64216421function update_post_cache( &$posts ) {
     
    64946494 * @since 1.5.0
    64956495 *
    6496  * @param array $posts             Array of Post objects
    6497  * @param string $post_type         Optional. Post type. Default 'post'.
    6498  * @param bool   $update_term_cache Optional. Whether to update the term cache. Default true.
    6499  * @param bool   $update_meta_cache Optional. Whether to update the meta cache. Default true.
     6496 * @param WP_Post[] $posts             Array of Post objects
     6497 * @param string    $post_type         Optional. Post type. Default 'post'.
     6498 * @param bool      $update_term_cache Optional. Whether to update the term cache. Default true.
     6499 * @param bool      $update_meta_cache Optional. Whether to update the meta cache. Default true.
    65006500 */
    65016501function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
     
    65496549 * @since 2.1.0
    65506550 *
    6551  * @param array $post_ids List of post IDs.
     6551 * @param int[] $post_ids Array of post IDs.
    65526552 * @return array|false Returns false if there is nothing to update or an array
    65536553 *                     of metadata.
  • trunk/src/wp-includes/taxonomy.php

    r45893 r45915  
    215215 * @global array $wp_taxonomies The registered taxonomies.
    216216 *
    217  * @param array|string|WP_Post $object Name of the type of taxonomy object, or an object (row from posts)
    218  * @param string               $output Optional. The type of output to return in the array. Accepts either
    219  *                                     taxonomy 'names' or 'objects'. Default 'names'.
    220  * @return array The names of all taxonomy of $object_type.
     217 * @param string|string[]|WP_Post $object Name of the type of taxonomy object, or an object (row from posts)
     218 * @param string                  $output Optional. The type of output to return in the array. Accepts either
     219 *                                       'names' or 'objects'. Default 'names'.
     220 * @return string[]|WP_Taxonomy[] The names or objects of all taxonomies of `$object_type`.
    221221 */
    222222function get_object_taxonomies( $object, $output = 'names' ) {
     
    19601960 * @since 4.7.0 Refactored to use WP_Term_Query, and to support any WP_Term_Query arguments.
    19611961 *
    1962  * @param int|array    $object_ids The ID(s) of the object(s) to retrieve.
    1963  * @param string|array $taxonomies The taxonomies to retrieve terms from.
    1964  * @param array|string $args       See WP_Term_Query::__construct() for supported arguments.
     1962 * @param int|int[]       $object_ids The ID(s) of the object(s) to retrieve.
     1963 * @param string|string[] $taxonomies The taxonomy names to retrieve terms from.
     1964 * @param array|string    $args       See WP_Term_Query::__construct() for supported arguments.
    19651965 * @return array|WP_Error The requested term data or empty array if no terms found.
    1966  *                        WP_Error if any of the $taxonomies don't exist.
     1966 *                        WP_Error if any of the taxonomies don't exist.
    19671967 */
    19681968function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
     
    19931993     * @since 4.9.0
    19941994     *
    1995      * @param array        $args       An array of arguments for retrieving terms for the given object(s).
    1996      *                                 See {@see wp_get_object_terms()} for details.
    1997      * @param int|array    $object_ids Object ID or array of IDs.
    1998      * @param string|array $taxonomies The taxonomies to retrieve terms from.
     1995     * @param array    $args       An array of arguments for retrieving terms for the given object(s).
     1996     *                             See {@see wp_get_object_terms()} for details.
     1997     * @param int[]    $object_ids Array of object IDs.
     1998     * @param string[] $taxonomies Array of taxonomy names to retrieve terms from.
    19991999     */
    20002000    $args = apply_filters( 'wp_get_object_terms_args', $args, $object_ids, $taxonomies );
     
    20402040     * @since 4.2.0
    20412041     *
    2042      * @param array $terms      An array of terms for the given object or objects.
    2043      * @param array $object_ids Array of object IDs for which `$terms` were retrieved.
    2044      * @param array $taxonomies Array of taxonomies from which `$terms` were retrieved.
    2045      * @param array $args       An array of arguments for retrieving terms for the given
    2046      *                          object(s). See wp_get_object_terms() for details.
     2042     * @param array    $terms      Array of terms for the given object or objects.
     2043     * @param int[]    $object_ids Array of object IDs for which terms were retrieved.
     2044     * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved.
     2045     * @param array    $args       Array of arguments for retrieving terms for the given
     2046     *                             object(s). See wp_get_object_terms() for details.
    20472047     */
    20482048    $terms = apply_filters( 'get_object_terms', $terms, $object_ids, $taxonomies, $args );
     
    20592059     * @since 2.8.0
    20602060     *
    2061      * @param array     $terms      An array of terms for the given object or objects.
    2062      * @param int|array $object_ids Object ID or array of IDs.
    2063      * @param string    $taxonomies SQL-formatted (comma-separated and quoted) list of taxonomy names.
    2064      * @param array     $args       An array of arguments for retrieving terms for the given object(s).
    2065      *                              See wp_get_object_terms() for details.
     2061     * @param array    $terms      Array of terms for the given object or objects.
     2062     * @param int[]    $object_ids Array of object IDs for which terms were retrieved.
     2063     * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved.
     2064     * @param array    $args       Array of arguments for retrieving terms for the given
     2065     *                             object(s). See wp_get_object_terms() for details.
    20662066     */
    20672067    return apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args );
     
    24222422 * @param string           $taxonomy  The context in which to relate the term to the object.
    24232423 * @param bool             $append    Optional. If false will delete difference of terms. Default false.
    2424  * @return array|WP_Error Term taxonomy IDs of the affected terms.
     2424 * @return array|WP_Error Term taxonomy IDs of the affected terms or WP_Error on failure.
    24252425 */
    24262426function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
     
    33663366 * @since 2.3.0
    33673367 *
    3368  * @param string|array $object_ids  Comma-separated list or array of term object IDs.
    3369  * @param array|string $object_type The taxonomy object type.
     3368 * @param string|int[]    $object_ids  Comma-separated list or array of term object IDs.
     3369 * @param string|string[] $object_type The taxonomy object type or array of the same.
    33703370 * @return void|false False if all of the terms in `$object_ids` are already cached.
    33713371 */
Note: See TracChangeset for help on using the changeset viewer.