_wp_get_post_revision_version example

// If we could get a lock, re-"add" the option to fire all the correct filters.     update_option( $lock$now );

    reset( $revisions );
    $add_last = true;

    do {
        $this_revision = current( $revisions );
        $prev_revision = next( $revisions );

        $this_revision_version = _wp_get_post_revision_version( $this_revision );

        // Something terrible happened.         if ( false === $this_revision_version ) {
            continue;
        }

        /* * 1 is the latest revision version, so we're already up to date. * No need to add a copy of the post as latest revision. */
        if ( 0 < $this_revision_version ) {
            
if ( post_type_supports( $ptype->name, 'revisions' ) ) {
        $revisions = wp_get_post_revisions(
            $post_id,
            array(
                'order'          => 'ASC',
                'posts_per_page' => 1,
            )
        );
        $revision  = current( $revisions );

        // Check if the revisions have been upgraded.         if ( $revisions && _wp_get_post_revision_version( $revision ) < 1 ) {
            _wp_upgrade_revisions_of_post( $postwp_get_post_revisions( $post_id ) );
        }
    }

    if ( isset( $post_data['visibility'] ) ) {
        switch ( $post_data['visibility'] ) {
            case 'public':
                $post_data['post_password'] = '';
                break;
            case 'password':
                unset( $post_data['sticky'] );
                
Home | Imprint | This part of the site doesn't use cookies.