Make WordPress Core

Ticket #28172: 28172.patch

File 28172.patch, 868 bytes (added by kevinlangleyjr, 8 years ago)

Moving {un}stick_post() function calls to be before wp_update_post()

  • src/wp-admin/includes/post.php

     
    371371                }
    372372        }
    373373
     374        if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
     375                if ( ! empty( $post_data['sticky'] ) )
     376                        stick_post( $post_ID );
     377                else
     378                        unstick_post( $post_ID );
     379        }
     380
    374381        add_meta( $post_ID );
    375382
    376383        update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
     
    394401
    395402        wp_set_post_lock( $post_ID );
    396403
    397         if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
    398                 if ( ! empty( $post_data['sticky'] ) )
    399                         stick_post( $post_ID );
    400                 else
    401                         unstick_post( $post_ID );
    402         }
    403 
    404404        return $post_ID;
    405405}
    406406