Changeset 43582 for trunk/src/wp-includes/post.php
- Timestamp:
- 08/27/2018 02:27:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r43571 r43582 1824 1824 1825 1825 /** 1826 * Retrieve list of latest posts or posts matchingcriteria.1826 * Retrieves an array of the latest posts, or posts matching the given criteria. 1827 1827 * 1828 1828 * The defaults are as follows: … … 1845 1845 * @type bool $suppress_filters Whether to suppress filters. Default true. 1846 1846 * } 1847 * @return array List of posts.1847 * @return WP_Post[]|int[] Array of post objects or post IDs. 1848 1848 */ 1849 1849 function get_posts( $args = null ) { … … 1892 1892 1893 1893 /** 1894 * Add meta data field to apost.1894 * Adds a meta field to the given post. 1895 1895 * 1896 1896 * Post meta data is called "Custom Fields" on the Administration Screen. … … 1919 1919 1920 1920 /** 1921 * Remove metadata matching criteria from a post.1921 * Deletes a post meta field for the given post ID. 1922 1922 * 1923 1923 * You can match based on the key, or key and value. Removing based on key and 1924 1924 * 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. 1926 1926 * 1927 1927 * @since 1.5.0 … … 1947 1947 1948 1948 /** 1949 * Retrieve post meta field for a post.1949 * Retrieves a post meta field for the given post ID. 1950 1950 * 1951 1951 * @since 1.5.0 … … 1954 1954 * @param string $key Optional. The meta key to retrieve. By default, returns 1955 1955 * 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 1960 1959 * field if $single is true. 1961 1960 */ … … 1965 1964 1966 1965 /** 1967 * Update post meta field based on post ID.1966 * Updates a post meta field based on the given post ID. 1968 1967 * 1969 1968 * Use the $prev_value parameter to differentiate between meta fields with the 1970 1969 * same key and post ID. 1971 1970 * 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. 1973 1972 * 1974 1973 * @since 1.5.0 … … 1977 1976 * @param string $meta_key Metadata key. 1978 1977 * @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. 1983 1981 */ 1984 1982 function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) { … … 1996 1994 1997 1995 /** 1998 * Delete everything from post meta matchingmeta key.1996 * Deletes everything from post meta matching the given meta key. 1999 1997 * 2000 1998 * @since 2.3.0 … … 6491 6489 6492 6490 /** 6493 * Return the post's parent post ID.6491 * Returns the ID of the post's parent. 6494 6492 * 6495 6493 * @since 3.1.0 6496 6494 * 6497 6495 * @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. 6499 6497 */ 6500 6498 function wp_get_post_parent_id( $post ) { … … 6560 6558 6561 6559 /** 6562 * Set a post thumbnail.6560 * Sets the post thumbnail (featured image) for the given post. 6563 6561 * 6564 6562 * @since 3.1.0 … … 6582 6580 6583 6581 /** 6584 * Remove a post thumbnail.6582 * Removes the thumbnail (featured image) from the given post. 6585 6583 * 6586 6584 * @since 3.3.0 6587 6585 * 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. 6589 6587 * @return bool True on success, false on failure. 6590 6588 */
Note: See TracChangeset
for help on using the changeset viewer.