Changeset 34575
- Timestamp:
- 09/26/2015 04:44:51 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r34574 r34575 3215 3215 $struct = isset( $args[3] ) ? $args[3] : array(); 3216 3216 3217 if ( ! $user = $this->login($username, $password ) ) 3218 return $this->error; 3217 if ( ! $user = $this->login( $username, $password ) ) { 3218 return $this->error; 3219 } 3219 3220 3220 3221 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 3221 3222 do_action( 'xmlrpc_call', 'wp.getComments' ); 3222 3223 3223 if ( isset( $struct['status'] ) ) 3224 if ( isset( $struct['status'] ) ) { 3224 3225 $status = $struct['status']; 3225 else3226 } else { 3226 3227 $status = ''; 3228 } 3227 3229 3228 3230 if ( ! current_user_can( 'moderate_comments' ) && 'approve' !== $status ) { … … 3231 3233 3232 3234 $post_id = ''; 3233 if ( isset($struct['post_id']) ) 3234 $post_id = absint($struct['post_id']); 3235 if ( isset( $struct['post_id'] ) ) { 3236 $post_id = absint( $struct['post_id'] ); 3237 } 3238 3239 $post_type = ''; 3240 if ( isset( $struct['post_type'] ) ) { 3241 $post_type_object = get_post_type_object( $struct['post_type'] ); 3242 if ( ! $post_type_object || ! post_type_supports( $post_type_object->name, 'comments' ) ) { 3243 return new IXR_Error( 404, __( 'Invalid post type.' ) ); 3244 } 3245 $post_type = $struct['post_type']; 3246 } 3235 3247 3236 3248 $offset = 0; 3237 if ( isset($struct['offset']) ) 3238 $offset = absint($struct['offset']); 3249 if ( isset( $struct['offset'] ) ) { 3250 $offset = absint( $struct['offset'] ); 3251 } 3239 3252 3240 3253 $number = 10; 3241 if ( isset($struct['number']) ) 3242 $number = absint($struct['number']); 3243 3244 $comments = get_comments( array( 'status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) ); 3254 if ( isset( $struct['number'] ) ) { 3255 $number = absint( $struct['number'] ); 3256 } 3257 3258 $comments = get_comments( array( 3259 'status' => $status, 3260 'post_id' => $post_id, 3261 'offset' => $offset, 3262 'number' => $number, 3263 'post_type' => $post_type, 3264 ) ); 3245 3265 3246 3266 $comments_struct = array();
Note: See TracChangeset
for help on using the changeset viewer.