Ticket #20662: 20662.diff
File 20662.diff, 1.0 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-xmlrpc-server.php
4897 4897 $post_ID = $postdata['ID'] = get_default_post_to_edit( $post_type, true )->ID; 4898 4898 4899 4899 // Only posts can be sticky 4900 if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) { 4901 if ( $content_struct['sticky'] == true ) 4900 if ( 'post' === $post_type && isset( $content_struct['sticky'] ) ) { 4901 $sticky = wp_validate_boolean( $content_struct['sticky'] ); 4902 if ( $sticky && ( 'private' === $postdata['post_status'] || ! empty( $postdata['post_password'] ) ) ) { 4903 return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) ); 4904 } 4905 4906 if ( $sticky ) { 4902 4907 stick_post( $post_ID ); 4903 elseif ( $content_struct['sticky'] == false )4908 } else { 4904 4909 unstick_post( $post_ID ); 4910 } 4905 4911 } 4906 4912 4907 4913 if ( isset($content_struct['custom_fields']) )