Make WordPress Core


Ignore:
Timestamp:
08/27/2018 02:27:22 PM (6 years ago)
Author:
johnbillion
Message:

Docs: Correct and improve various inline documentation.

See #42505

File:
1 edited

Legend:

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

    r43571 r43582  
    18241824
    18251825/**
    1826  * Retrieve list of latest posts or posts matching criteria.
     1826 * Retrieves an array of the latest posts, or posts matching the given criteria.
    18271827 *
    18281828 * The defaults are as follows:
     
    18451845 *     @type bool       $suppress_filters Whether to suppress filters. Default true.
    18461846 * }
    1847  * @return array List of posts.
     1847 * @return WP_Post[]|int[] Array of post objects or post IDs.
    18481848 */
    18491849function get_posts( $args = null ) {
     
    18921892
    18931893/**
    1894  * Add meta data field to a post.
     1894 * Adds a meta field to the given post.
    18951895 *
    18961896 * Post meta data is called "Custom Fields" on the Administration Screen.
     
    19191919
    19201920/**
    1921  * Remove metadata matching criteria from a post.
     1921 * Deletes a post meta field for the given post ID.
    19221922 *
    19231923 * You can match based on the key, or key and value. Removing based on key and
    19241924 * value, will keep from removing duplicate metadata with the same key. It also
    1925  * allows removing all metadata matching key, if needed.
     1925 * allows removing all metadata matching the key, if needed.
    19261926 *
    19271927 * @since 1.5.0
     
    19471947
    19481948/**
    1949  * Retrieve post meta field for a post.
     1949 * Retrieves a post meta field for the given post ID.
    19501950 *
    19511951 * @since 1.5.0
     
    19541954 * @param string $key     Optional. The meta key to retrieve. By default, returns
    19551955 *                        data for all keys. Default empty.
    1956  * @param bool   $single  Optional, default is false.
    1957  *                        If true, return only the first value of the specified meta_key.
    1958  *                        This parameter has no effect if meta_key is not specified.
    1959  * @return mixed Will be an array if $single is false. Will be value of meta data
     1956 * @param bool   $single  Optional. If true, returns only the first value for the specified meta key.
     1957 *                        This parameter has no effect if $key is not specified. Default false.
     1958 * @return mixed Will be an array if $single is false. Will be value of the meta
    19601959 *               field if $single is true.
    19611960 */
     
    19651964
    19661965/**
    1967  * Update post meta field based on post ID.
     1966 * Updates a post meta field based on the given post ID.
    19681967 *
    19691968 * Use the $prev_value parameter to differentiate between meta fields with the
    19701969 * same key and post ID.
    19711970 *
    1972  * If the meta field for the post does not exist, it will be added.
     1971 * If the meta field for the post does not exist, it will be added and its ID returned.
    19731972 *
    19741973 * @since 1.5.0
     
    19771976 * @param string $meta_key   Metadata key.
    19781977 * @param mixed  $meta_value Metadata value. Must be serializable if non-scalar.
    1979  * @param mixed  $prev_value Optional. Previous value to check before removing.
    1980  *                           Default empty.
    1981  * @return int|bool Meta ID if the key didn't exist, true on successful update,
    1982  *                  false on failure.
     1978 * @param mixed  $prev_value Optional. Previous value to check before updating.
     1979 * @return int|bool The new meta field ID if a field with the given key didn't exist and was
     1980 *                  therefore added, true on successful update, false on failure.
    19831981 */
    19841982function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    19961994
    19971995/**
    1998  * Delete everything from post meta matching meta key.
     1996 * Deletes everything from post meta matching the given meta key.
    19991997 *
    20001998 * @since 2.3.0
     
    64916489
    64926490/**
    6493  * Return the post's parent post ID.
     6491 * Returns the ID of the post's parent.
    64946492 *
    64956493 * @since 3.1.0
    64966494 *
    64976495 * @param int|WP_Post $post Post ID or post object. Defaults to global $post.
    6498  * @return int|false Post parent ID, otherwise false.
     6496 * @return int|false Post parent ID (which can be 0 if there is no parent), or false if the post does not exist.
    64996497 */
    65006498function wp_get_post_parent_id( $post ) {
     
    65606558
    65616559/**
    6562  * Set a post thumbnail.
     6560 * Sets the post thumbnail (featured image) for the given post.
    65636561 *
    65646562 * @since 3.1.0
     
    65826580
    65836581/**
    6584  * Remove a post thumbnail.
     6582 * Removes the thumbnail (featured image) from the given post.
    65856583 *
    65866584 * @since 3.3.0
    65876585 *
    6588  * @param int|WP_Post $post Post ID or post object where thumbnail should be removed from.
     6586 * @param int|WP_Post $post Post ID or post object from which the thumbnail should be removed.
    65896587 * @return bool True on success, false on failure.
    65906588 */
Note: See TracChangeset for help on using the changeset viewer.