Make WordPress Core


Ignore:
Timestamp:
11/01/2014 08:19:26 PM (10 years ago)
Author:
wonderboymusic
Message:

Improve some post_status-related documentation.

Props ericlewis.
See #30230.

File:
1 edited

Legend:

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

    r30119 r30155  
    7171
    7272/**
    73  * Saves an already existing post as a post revision.
    74  *
    75  * Typically used immediately after post updates.
    76  * Adds a copy of the current post as a revision, so latest revision always matches current post
    77  *
    78  * @since 2.6.0
    79  *
    80  * @param int $post_id The ID of the post to save as a revision.
     73 * Creates a revision for the current version of a post.
     74 *
     75 * Typically used immediately after a post update, as every update is a revision,
     76 * and the most recent revision always matches the current post.
     77 *
     78 * @since 2.6.0
     79 *
     80 * @param  int  $post_id The ID of the post to save as a revision.
    8181 * @return mixed Null or 0 if error, new revision ID, if success.
    8282 */
     
    157157    $return = _wp_put_post_revision( $post );
    158158
     159    // If a limit for the number of revisions to keep has been set,
     160    // delete the oldest ones.
    159161    $revisions_to_keep = wp_revisions_to_keep( $post );
    160162
     
    162164        return $return;
    163165
    164     // all revisions and autosaves
    165166    $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
    166167
     
    447448/**
    448449 * Determine how many revisions to retain for a given post.
    449  * By default, an infinite number of revisions are stored if a post type supports revisions.
     450 *
     451 * By default, an infinite number of revisions are kept.
     452 *
     453 * The constant WP_POST_REVISIONS can be set in wp-config to specify the limit
     454 * of revisions to keep.
    450455 *
    451456 * @since 3.6.0
    452457 *
    453  * @param object $post The post object.
     458 * @param  object $post The post object.
    454459 * @return int The number of revisions to keep.
    455460 */
Note: See TracChangeset for help on using the changeset viewer.