]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post.php
WordPress 4.1.4-scripts
[autoinstalls/wordpress.git] / wp-includes / post.php
index d9d48a56fe28d01c9617b67dac2e193490010bc5..c8963e6b2d9323694072ab2dabf0f532070500ee 100644 (file)
@@ -372,8 +372,8 @@ function get_children( $args = '', $output = OBJECT ) {
  * referenced.
  *
  * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before
- * the <code><!--more--></code>. The 'extended' key has the content after the
- * <code><!--more--></code> comment. The 'more_text' key has the custom "Read More" text.
+ * the `<!--more-->`. The 'extended' key has the content after the
+ * `<!--more-->` comment. The 'more_text' key has the custom "Read More" text.
  *
  * @since 1.0.0
  *
@@ -839,7 +839,7 @@ function get_post_field( $field, $post, $context = 'display' ) {
  * @since 2.0.0
  *
  * @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
- * @return string|bool The mime type on success, false on failure.
+ * @return string|false The mime type on success, false on failure.
  */
 function get_post_mime_type( $ID = '' ) {
        $post = get_post($ID);
@@ -859,7 +859,7 @@ function get_post_mime_type( $ID = '' ) {
  * @since 2.0.0
  *
  * @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
- * @return string|bool Post status on success, false on failure.
+ * @return string|false Post status on success, false on failure.
  */
 function get_post_status( $ID = '' ) {
        $post = get_post($ID);
@@ -1060,7 +1060,7 @@ function get_post_status_object( $post_status ) {
 }
 
 /**
- * Get a list of all registered post status objects.
+ * Get a list of post statuses.
  *
  * @since 3.0.0
  *
@@ -1068,9 +1068,9 @@ function get_post_status_object( $post_status ) {
  *
  * @see register_post_status()
  *
- * @param array|string $args     Optional. Array or string of post status arguments. Default array.
- * @param string       $output   Optional. The type of output to return. Accepts post status 'names'
- *                               or 'objects'. Default 'names'.
+ * @param array|string $args     Optional. Array or string of post status arguments to compare against
+ *                               properties of the global `$wp_post_statuses objects`. Default empty array.
+ * @param string       $output   Optional. The type of output to return, either 'names' or 'objects'. Default 'names'.
  * @param string       $operator Optional. The logical operation to perform. 'or' means only one element
  *                               from the array needs to match; 'and' means all elements must match.
  *                               Default 'and'.
@@ -1124,7 +1124,7 @@ function post_type_exists( $post_type ) {
  * @since 2.1.0
  *
  * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
- * @return string|bool Post type on success, false on failure.
+ * @return string|false Post type on success, false on failure.
  */
 function get_post_type( $post = null ) {
        if ( $post = get_post( $post ) )
@@ -1161,15 +1161,15 @@ function get_post_type_object( $post_type ) {
  *
  * @global array $wp_post_types List of post types.
  *
- * @see register_post_type()
+ * @see register_post_type() for accepted arguments.
  *
  * @param array|string $args     Optional. An array of key => value arguments to match against
  *                               the post type objects. Default empty array.
  * @param string       $output   Optional. The type of output to return. Accepts post type 'names'
  *                               or 'objects'. Default 'names'.
- * @param string       $operator Optaionl. The logical operation to perform. 'or' means only one
+ * @param string       $operator Optional. The logical operation to perform. 'or' means only one
  *                               element from the array needs to match; 'and' means all elements
- *                               must match. Default 'and'.
+ *                               must match. Accepts 'or' or 'and'. Default 'and'.
  * @return array A list of post type names or objects.
  */
 function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) {
@@ -1352,7 +1352,7 @@ function register_post_type( $post_type, $args = array() ) {
 
        // If not set, default to the whether the full UI is shown.
        if ( null === $args->show_in_admin_bar )
-               $args->show_in_admin_bar = true === $args->show_in_menu;
+               $args->show_in_admin_bar = (bool) $args->show_in_menu;
 
        // If not set, default to the setting for public.
        if ( null === $args->show_in_nav_menus )
@@ -1594,8 +1594,8 @@ function _post_type_meta_capabilities( $capabilities = null ) {
  * - singular_name - name for one object of this post type. Default is Post/Page
  * - add_new - Default is Add New for both hierarchical and non-hierarchical types.
  *             When internationalizing this string, please use a gettext context
- *             {@see http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
- *             matching your post type. Example: <code>_x('Add New', 'product');</code>.
+ *             {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
+ *             matching your post type. Example: `_x( 'Add New', 'product' );`.
  * - add_new_item - Default is Add New Post/Add New Page.
  * - edit_item - Default is Edit Post/Edit Page.
  * - new_item - Default is New Post/New Page.
@@ -1606,7 +1606,7 @@ function _post_type_meta_capabilities( $capabilities = null ) {
  * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical
  *                       ones the default is 'Parent Page:'.
  * - all_items - String for the submenu. Default is All Posts/All Pages.
- * - menu_name - Default is the same as <code>name</code>.
+ * - menu_name - Default is the same as `name`.
  *
  * Above, the first default value is for non-hierarchical post types (like posts)
  * and the second one is for hierarchical post types (like pages).
@@ -1641,7 +1641,7 @@ function get_post_type_labels( $post_type_object ) {
        /**
         * Filter the labels of a specific post type.
         *
-        * The dynamic portion of the hook name, $post_type, refers to
+        * The dynamic portion of the hook name, `$post_type`, refers to
         * the post type slug.
         *
         * @since 3.5.0
@@ -1789,7 +1789,7 @@ function post_type_supports( $post_type, $feature ) {
  *
  * @since 2.5.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param int    $post_id   Optional. Post ID to change post type. Default 0.
  * @param string $post_type Optional. Post type. Accepts 'post' or 'page' to
@@ -2145,7 +2145,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific post field to edit.
                         *
-                        * The dynamic portion of the hook name, $field, refers to the post
+                        * The dynamic portion of the hook name, `$field`, refers to the post
                         * field name.
                         *
                         * @since 2.3.0
@@ -2158,7 +2158,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific post field to edit.
                         *
-                        * The dynamic portion of the hook name, $field_no_prefix, refers to
+                        * The dynamic portion of the hook name, `$field_no_prefix`, refers to
                         * the post field name.
                         *
                         * @since 2.3.0
@@ -2185,7 +2185,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific post field before saving.
                         *
-                        * The dynamic portion of the hook name, $field, refers to the post
+                        * The dynamic portion of the hook name, `$field`, refers to the post
                         * field name.
                         *
                         * @since 2.3.0
@@ -2197,7 +2197,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific field before saving.
                         *
-                        * The dynamic portion of the hook name, $field_no_prefix, refers
+                        * The dynamic portion of the hook name, `$field_no_prefix`, refers
                         * to the post field name.
                         *
                         * @since 2.3.0
@@ -2211,7 +2211,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific post field before saving.
                         *
-                        * The dynamic portion of the hook name, $field, refers to the post
+                        * The dynamic portion of the hook name, `$field`, refers to the post
                         * field name.
                         *
                         * @since 2.3.0
@@ -2228,7 +2228,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
                        /**
                         * Filter the value of a specific post field for display.
                         *
-                        * The dynamic portion of the hook name, $field, refers to the post
+                        * The dynamic portion of the hook name, `$field`, refers to the post
                         * field name.
                         *
                         * @since 2.3.0
@@ -2554,7 +2554,7 @@ function wp_post_mime_type_where( $post_mime_types, $table_alias = '' ) {
  *
  * @since 1.0.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  * @see wp_delete_attachment()
  * @see wp_trash_post()
  *
@@ -2799,7 +2799,7 @@ function wp_untrash_post( $post_id = 0 ) {
  *
  * @since 2.9.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
  * @return mixed False on failure.
@@ -2856,7 +2856,7 @@ function wp_trash_post_comments( $post = null ) {
  * @since 2.9.0
  *
  * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
- * @return mixed False on failure.
+ * @return null|bool Null on failure.
  */
 function wp_untrash_post_comments( $post = null ) {
        global $wpdb;
@@ -2942,8 +2942,6 @@ function wp_get_post_categories( $post_id = 0, $args = array() ) {
  *
  * @since 2.3.0
  *
- * @uses wp_get_object_terms()
- *
  * @param int   $post_id Optional. The Post ID. Does not default to the ID of the
  *                       global $post. Defualt 0.
  * @param array $args Optional. Overwrite the defaults
@@ -2962,8 +2960,6 @@ function wp_get_post_tags( $post_id = 0, $args = array() ) {
  *
  * @since 2.8.0
  *
- * @uses wp_get_object_terms()
- *
  * @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'.
@@ -2988,7 +2984,6 @@ function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array(
  *
  * @see get_posts()
  *
- * @param string $deprecated Not used.
  * @param array  $args       Optional. Arguments to retrieve posts. Default empty array.
  * @param string $output     Optional. Type of output. Accepts ARRAY_A or ''. Default ARRAY_A.
  * @return array|bool Associative array if $output equals ARRAY_A, array or false if no results.
@@ -3481,7 +3476,7 @@ function wp_insert_post( $postarr, $wp_error = false ) {
        /**
         * Fires once a post has been saved.
         *
-        * The dynamic portion of the hook name, $post->post_type, refers to
+        * The dynamic portion of the hook name, `$post->post_type`, refers to
         * the post type slug.
         *
         * @since 3.7.0
@@ -3677,7 +3672,6 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
        if ( ! is_array( $feeds ) )
                $feeds = array();
 
-       $hierarchical_post_types = get_post_types( array('hierarchical' => true) );
        if ( 'attachment' == $post_type ) {
                // Attachment slugs must be unique across all types.
                $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1";
@@ -3700,7 +3694,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                        } while ( $post_name_check );
                        $slug = $alt_post_name;
                }
-       } elseif ( in_array( $post_type, $hierarchical_post_types ) ) {
+       } elseif ( is_post_type_hierarchical( $post_type ) ) {
                if ( 'nav_menu_item' == $post_type )
                        return $slug;
 
@@ -3708,8 +3702,8 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                 * Page slugs must be unique within their own trees. Pages are in a separate
                 * namespace than posts so page slugs are allowed to overlap post slugs.
                 */
-               $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
-               $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) );
+               $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1";
+               $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) );
 
                /**
                 * Filter whether the post slug would make a bad hierarchical post slug.
@@ -3725,7 +3719,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                        $suffix = 2;
                        do {
                                $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
-                               $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID, $post_parent ) );
+                               $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) );
                                $suffix++;
                        } while ( $post_name_check );
                        $slug = $alt_post_name;
@@ -3921,9 +3915,9 @@ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $appe
  *
  * @since 2.3.0
  *
- * @param string $new_status Transition to this post status.
- * @param string $old_status Previous post status.
- * @param object $post Post data.
+ * @param string  $new_status Transition to this post status.
+ * @param string  $old_status Previous post status.
+ * @param WP_Post $post Post data.
  */
 function wp_transition_post_status( $new_status, $old_status, $post ) {
        /**
@@ -3940,7 +3934,7 @@ function wp_transition_post_status( $new_status, $old_status, $post ) {
        /**
         * Fires when a post is transitioned from one status to another.
         *
-        * The dynamic portions of the hook name, $new_status and $old status,
+        * The dynamic portions of the hook name, `$new_status` and `$old status`,
         * refer to the old and new post statuses, respectively.
         *
         * @since 2.3.0
@@ -3952,7 +3946,7 @@ function wp_transition_post_status( $new_status, $old_status, $post ) {
        /**
         * Fires when a post is transitioned from one status to another.
         *
-        * The dynamic portions of the hook name, $new_status and $post->post_type,
+        * The dynamic portions of the hook name, `$new_status` and `$post->post_type`,
         * refer to the new post status and post type, respectively.
         *
         * @since 2.3.0
@@ -4283,19 +4277,21 @@ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' )
  *
  * @since 1.5.1
  *
- * @param int   $page_id Page ID.
- * @param array $pages   List of pages' objects.
+ * @param int   $page_id    Page ID.
+ * @param array $pages      List of pages' objects.
  * @return array List of page children.
  */
-function get_page_children($page_id, $pages) {
+function get_page_children( $page_id, $pages ) {
        $page_list = array();
        foreach ( (array) $pages as $page ) {
                if ( $page->post_parent == $page_id ) {
                        $page_list[] = $page;
-                       if ( $children = get_page_children($page->ID, $pages) )
-                               $page_list = array_merge($page_list, $children);
+                       if ( $children = get_page_children( $page->ID, $pages ) ) {
+                               $page_list = array_merge( $page_list, $children );
+                       }
                }
        }
+
        return $page_list;
 }
 
@@ -4383,35 +4379,38 @@ function get_page_uri( $page ) {
  *
  * @since 1.5.0
  *
- * @param mixed $args {
- *     Array or string of arguments. Optional.
- *
- *     @type int    'child_of'     Page ID to return child and grandchild pages of. Default 0, or no restriction.
- *     @type string 'sort_order'   How to sort retrieved pages.
- *                                 Default 'ASC'. Accepts 'ASC', 'DESC'.
- *     @type string 'sort_column'  What columns to sort pages by, comma-separated.
- *                                 Default 'post_title'. Accepts 'post_author', 'post_date', 'post_title', 'post_name',
- *                                 'post_modified', 'post_modified_gmt', 'menu_order', 'post_parent', 'ID', 'rand',
- *                                 'comment_count'. 'post_' can be omitted for any values that start with it.
- *     @type bool   'hierarchical' Whether to return pages hierarchically. Default true.
- *     @type array  'exclude'      Array of page IDs to exclude.
- *     @type array  'include'      Array of page IDs to include. Cannot be used with 'child_of', 'parent', 'exclude',
- *                                 'meta_key', 'meta_value', or 'hierarchical'.
- *     @type string 'meta_key'     Only include pages with this meta key.
- *     @type string 'meta_value'   Only include pages with this meta value.
- *     @type string 'authors'      A comma-separated list of author IDs.
- *     @type int    'parent'       Page ID to return direct children of. 'hierarchical' must be false.
- *                                 Default -1, or no restriction.
- *     @type int    'exclude_tree' Remove all children of the given ID from returned pages.
- *     @type int    'number'       The number of pages to return. Default 0, or all pages.
- *     @type int    'offset'       The number of pages to skip before returning. Requires 'number'.
- *                                 Default 0.
- *     @type string 'post_type'    The post type to query.
- *                                 Default 'page'.
- *     @type string 'post_status'  A comma-separated list of post status types to include.
- *                                 Default 'publish'.
+ * @param array|string $args {
+ *     Optional. Array or string of arguments to retrieve pages.
+ *
+ *     @type int          $child_of     Page ID to return child and grandchild pages of.
+ *                                      Default 0, or no restriction.
+ *     @type string       $sort_order   How to sort retrieved pages. Accepts 'ASC', 'DESC'. Default 'ASC'.
+ *     @type string       $sort_column  What columns to sort pages by, comma-separated. Accepts 'post_author',
+ *                                      'post_date', 'post_title', 'post_name', 'post_modified', 'menu_order',
+ *                                      'post_modified_gmt', 'post_parent', 'ID', 'rand', 'comment_count'.
+ *                                      'post_' can be omitted for any values that start with it.
+ *                                      Default 'post_title'.
+ *     @type bool         $hierarchical Whether to return pages hierarchically. Default true.
+ *     @type array        $exclude      Array of page IDs to exclude. Default empty array.
+ *     @type array        $include      Array of page IDs to include. Cannot be used with `$child_of`,
+ *                                      `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`.
+ *                                      Default empty array.
+ *     @type string       $meta_key     Only include pages with this meta key. Default empty.
+ *     @type string       $meta_value   Only include pages with this meta value. Requires `$meta_key`.
+ *                                      Default empty.
+ *     @type string       $authors      A comma-separated list of author IDs. Default empty.
+ *     @type int          $parent       Page ID to return direct children of. `$hierarchical` must be false.
+ *                                      Default -1, or no restriction.
+ *     @type string|array $exclude_tree Comma-separated string or array of page IDs to exclude.
+ *                                      Default empty array.
+ *     @type int          $number       The number of pages to return. Default 0, or all pages.
+ *     @type int          $offset       The number of pages to skip before returning. Requires `$number`.
+ *                                      Default 0.
+ *     @type string       $post_type    The post type to query. Default 'page'.
+ *     @type string       $post_status  A comma-separated list of post status types to include.
+ *                                      Default 'publish'.
  * }
- * @return array List of pages matching defaults or $args.
+ * @return array List of pages matching defaults or `$args`.
  */
 function get_pages( $args = array() ) {
        global $wpdb;
@@ -4652,7 +4651,7 @@ function get_pages( $args = array() ) {
 
        wp_cache_set( $cache_key, $page_structure, 'posts' );
 
-       // Convert to WP_Post instances.
+       // Convert to WP_Post instances
        $pages = array_map( 'get_post', $pages );
 
        /**
@@ -4719,10 +4718,15 @@ function is_local_attachment($url) {
 function wp_insert_attachment( $args, $file = false, $parent = 0 ) {
        $defaults = array(
                'file'        => $file,
-               'post_parent' => $parent
+               'post_parent' => 0
        );
+
        $data = wp_parse_args( $args, $defaults );
 
+       if ( ! empty( $parent ) ) {
+               $data['post_parent'] = $parent;
+       }
+
        $data['post_type'] = 'attachment';
 
        return wp_insert_post( $data );
@@ -4740,7 +4744,7 @@ function wp_insert_attachment( $args, $file = false, $parent = 0 ) {
  *
  * @since 2.0.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param int  $post_id      Attachment ID.
  * @param bool $force_delete Optional. Whether to bypass trash and force deletion.
@@ -4766,12 +4770,6 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
        $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
        $file = get_attached_file( $post_id );
 
-       $intermediate_sizes = array();
-       foreach ( get_intermediate_image_sizes() as $size ) {
-               if ( $intermediate = image_get_intermediate_size( $post_id, $size ) )
-                       $intermediate_sizes[] = $intermediate;
-       }
-
        if ( is_multisite() )
                delete_transient( 'dirsize_cache' );
 
@@ -4820,10 +4818,13 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
        }
 
        // Remove intermediate and backup images if there are any.
-       foreach ( $intermediate_sizes as $intermediate ) {
-               /** This filter is documented in wp-admin/custom-header.php */
-               $intermediate_file = apply_filters( 'wp_delete_file', $intermediate['path'] );
-               @ unlink( path_join($uploadpath['basedir'], $intermediate_file) );
+       if ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) {
+               foreach ( $meta['sizes'] as $size => $sizeinfo ) {
+                       $intermediate_file = str_replace( basename( $file ), $sizeinfo['file'], $file );
+                       /** This filter is documented in wp-admin/custom-header.php */
+                       $intermediate_file = apply_filters( 'wp_delete_file', $intermediate_file );
+                       @ unlink( path_join( $uploadpath['basedir'], $intermediate_file ) );
+               }
        }
 
        if ( is_array($backup_sizes) ) {
@@ -5328,7 +5329,7 @@ function get_lastpostdate( $timezone = 'server' ) {
 }
 
 /**
- * Retrieve last post modified date depending on timezone.
+ * Get the timestamp of the last time any post was modified.
  *
  * The server timezone is the default and is the difference between GMT and
  * server time. The 'blog' value is just when the last post was modified. The
@@ -5336,9 +5337,12 @@ function get_lastpostdate( $timezone = 'server' ) {
  *
  * @since 1.2.0
  *
- * @param string $timezone The location to get the time. Accepts 'gmt', 'blog', or 'server'.
+ * @param string $timezone Optional. The timezone for the timestamp. Uses the server's internal timezone.
+ *                         Accepts 'server', 'blog', 'gmt'. or 'server'. 'server' uses the server's
+ *                         internal timezone. 'blog' uses the `post_modified` field, which proxies
+ *                         to the timezone set for the site. 'gmt' uses the `post_modified_gmt` field.
  *                         Default 'server'.
- * @return string The date the post was last modified.
+ * @return string The timestamp.
  */
 function get_lastpostmodified( $timezone = 'server' ) {
        $lastpostmodified = _get_last_post_time( $timezone, 'modified' );
@@ -5354,19 +5358,21 @@ function get_lastpostmodified( $timezone = 'server' ) {
         *
         * @param string $lastpostmodified Date the last post was modified.
         * @param string $timezone         Location to use for getting the post modified date.
+        *                                 See {@see get_lastpostmodified()} for accepted `$timezone` values.
         */
        return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
 }
 
 /**
- * Retrieve latest post date data based on timezone.
+ * Get the timestamp of the last time any post was modified or published.
  *
- * @access private
  * @since 3.1.0
+ * @access private
  *
- * @param string $timezone The location to get the time. Accepts 'gmt', 'blog', or 'server'.
- * @param string $field Field to check. Can be 'date' or 'modified'.
- * @return string The date.
+ * @param string $timezone The timezone for the timestamp. See {@see get_lastpostmodified()}
+ *                         for information on accepted values.
+ * @param string $field    Post field to check. Accepts 'date' or 'modified'.
+ * @return string The timestamp.
  */
 function _get_last_post_time( $timezone, $field ) {
        global $wpdb;
@@ -5432,7 +5438,7 @@ function update_post_cache( &$posts ) {
  *
  * @since 2.0.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param int|WP_Post $post Post ID or post object to remove from the cache.
  */
@@ -5590,7 +5596,7 @@ function clean_attachment_cache( $id, $clean_terms = false ) {
  * @access private
  *
  * @see wp_clear_scheduled_hook()
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param string  $new_status New post status.
  * @param string  $old_status Previous post status.
@@ -5688,7 +5694,7 @@ function _publish_post_hook( $post_id ) {
  *
  * @since 3.1.0
  *
- * @param int $post_id
+ * @param int $post_ID
  *
  * @return int|bool Post parent ID, otherwise false.
  */
@@ -5782,7 +5788,7 @@ function delete_post_thumbnail( $post ) {
  *
  * @since 3.4.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  */
 function wp_delete_auto_drafts() {
        global $wpdb;
@@ -5824,7 +5830,7 @@ function _update_term_count_on_transition_post_status( $new_status, $old_status,
  *
  * @see update_post_caches()
  *
- * @param array $post_ids          ID list
+ * @param array $ids               ID list
  * @param bool  $update_term_cache Optional. Whether to update the term cache. Default true.
  * @param bool  $update_meta_cache Optional. Whether to update the meta cache. Default true.
  */