WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/22/2014 04:55:37 AM (7 years ago)
Author:
azaozz
Message:

Autosave: refactor autosave.js, use heartbeat for transport and move all "Add/Edit Post" related functionality to post.js. See #25272.

File:
1 edited

Legend:

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

    r24790 r26995  
    216216 * @param int|object|array $post Post ID, post object OR post array.
    217217 * @param bool $autosave Optional. Is the revision an autosave?
    218  * @return mixed Null or 0 if error, new revision ID if success.
     218 * @return mixed WP_Error or 0 if error, new revision ID if success.
    219219 */
    220220function _wp_put_post_revision( $post = null, $autosave = false ) {
     
    224224        $post = get_post($post, ARRAY_A);
    225225
    226     if ( !$post || empty($post['ID']) )
    227         return;
     226    if ( ! $post || empty($post['ID']) )
     227        return new WP_Error( 'invalid_post', __( 'Invalid post ID' ) );
    228228
    229229    if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
Note: See TracChangeset for help on using the changeset viewer.