WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/21/2019 05:40:58 PM (2 months ago)
Author:
johnbillion
Message:

Docs: Docblock corrections and improvements, mostly related to various pre_* filters.

See #47110

File:
1 edited

Legend:

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

    r46196 r46232  
    29362936     * @since 4.4.0
    29372937     *
    2938      * @param bool    $delete       Whether to go forward with deletion.
    2939      * @param WP_Post $post         Post object.
    2940      * @param bool    $force_delete Whether to bypass the trash.
     2938     * @param bool|null $delete       Whether to go forward with deletion.
     2939     * @param WP_Post   $post         Post object.
     2940     * @param bool      $force_delete Whether to bypass the trash.
    29412941     */
    29422942    $check = apply_filters( 'pre_delete_post', null, $post, $force_delete );
     
    31053105     * @since 4.9.0
    31063106     *
    3107      * @param bool    $trash Whether to go forward with trashing.
    3108      * @param WP_Post $post  Post object.
     3107     * @param bool|null $trash Whether to go forward with trashing.
     3108     * @param WP_Post   $post  Post object.
    31093109     */
    31103110    $check = apply_filters( 'pre_trash_post', null, $post );
     
    31743174     * @since 4.9.0
    31753175     *
    3176      * @param bool    $untrash Whether to go forward with untrashing.
    3177      * @param WP_Post $post    Post object.
     3176     * @param bool|null $untrash Whether to go forward with untrashing.
     3177     * @param WP_Post   $post    Post object.
    31783178     */
    31793179    $check = apply_filters( 'pre_untrash_post', null, $post );
     
    42854285     * @since 5.1.0
    42864286     *
    4287      * @param string $override_slug Short-circuit return value.
    4288      * @param string $slug          The desired slug (post_name).
    4289      * @param int    $post_ID       Post ID.
    4290      * @param string $post_status   The post status.
    4291      * @param string $post_type     Post type.
    4292      * @param int    $post_parent   Post parent ID.
     4287     * @param string|null $override_slug Short-circuit return value.
     4288     * @param string      $slug          The desired slug (post_name).
     4289     * @param int         $post_ID       Post ID.
     4290     * @param string      $post_status   The post status.
     4291     * @param string      $post_type     Post type.
     4292     * @param int         $post_parent   Post parent ID.
    42934293     */
    42944294    $override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $post_type, $post_parent );
     
    63526352
    63536353/**
    6354  * Retrieve the date that the last post was published.
     6354 * Retrieves the most recent time that a post on the site was published.
    63556355 *
    63566356 * The server timezone is the default and is the difference between GMT and
     
    63636363 * @param string $timezone  Optional. The timezone for the timestamp. Accepts 'server', 'blog', or 'gmt'.
    63646364 *                          'server' uses the server's internal timezone.
    6365  *                          'blog' uses the `post_modified` field, which proxies to the timezone set for the site.
    6366  *                          'gmt' uses the `post_modified_gmt` field.
     6365 *                          'blog' uses the `post_date` field, which proxies to the timezone set for the site.
     6366 *                          'gmt' uses the `post_date_gmt` field.
    63676367 *                          Default 'server'.
    63686368 * @param string $post_type Optional. The post type to check. Default 'any'.
     
    63716371function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
    63726372    /**
    6373      * Filters the date the last post was published.
     6373     * Filters the most recent time that a post on the site was published.
    63746374     *
    63756375     * @since 2.3.0
     
    63836383
    63846384/**
    6385  * Get the timestamp of the last time any post was modified.
     6385 * Get the most recent time that a post on the site was modified.
    63866386 *
    63876387 * The server timezone is the default and is the difference between GMT and
     
    63966396 *                          Default 'server'.
    63976397 * @param string $post_type Optional. The post type to check. Default 'any'.
    6398  * @return string The timestamp.
     6398 * @return string The timestamp in 'Y-m-d H:i:s' format.
    63996399 */
    64006400function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
     
    64046404     * @since 4.4.0
    64056405     *
    6406      * @param string $lastpostmodified Date the last post was modified.
    6407      *                                 Returning anything other than false will short-circuit the function.
    6408      * @param string $timezone         Location to use for getting the post modified date.
    6409      *                                 See get_lastpostdate() for accepted `$timezone` values.
    6410      * @param string $post_type        The post type to check.
     6406     * @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format, or
     6407     *                                       false. Returning anything other than false will short-circuit the function.
     6408     * @param string       $timezone         Location to use for getting the post modified date.
     6409     *                                       See get_lastpostdate() for accepted `$timezone` values.
     6410     * @param string       $post_type        The post type to check.
    64116411     */
    64126412    $lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type );
     
    64236423
    64246424    /**
    6425      * Filters the date the last post was modified.
     6425     * Filters the most recent time that a post was modified.
    64266426     *
    64276427     * @since 2.3.0
    64286428     *
    6429      * @param string $lastpostmodified Date the last post was modified.
     6429     * @param string $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
    64306430     * @param string $timezone         Location to use for getting the post modified date.
    64316431     *                                 See get_lastpostdate() for accepted `$timezone` values.
     
    64356435
    64366436/**
    6437  * Get the timestamp of the last time any post was modified or published.
     6437 * Gets the timestamp of the last time any post was modified or published.
    64386438 *
    64396439 * @since 3.1.0
     
    64476447 * @param string $field     Post field to check. Accepts 'date' or 'modified'.
    64486448 * @param string $post_type Optional. The post type to check. Default 'any'.
    6449  * @return string|false The timestamp.
     6449 * @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on error.
    64506450 */
    64516451function _get_last_post_time( $timezone, $field, $post_type = 'any' ) {
Note: See TracChangeset for help on using the changeset viewer.