Make WordPress Core

Ticket #20662: 20662.patch

File 20662.patch, 834 bytes (added by chriscct7, 10 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    45794579                $post_ID = $postdata['ID'] = get_default_post_to_edit( $post_type, true )->ID;
    45804580
    45814581                // Only posts can be sticky
     4582                if ( $postdata['post_status'] == 'private' || ! empty( $postdata['post_password'] ) ) {
     4583                        // Error if the client tried to stick the post, otherwise, silently unstick.
     4584                        if ( ! empty( $postdata['sticky'] ) ) {
     4585                                return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );
     4586                        }
     4587                }
     4588               
    45824589                if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
    45834590                        if ( $content_struct['sticky'] == true )
    45844591                                stick_post( $post_ID );