Changeset 16900 for trunk/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 12/13/2010 09:21:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r16873 r16900 1102 1102 if ( !current_user_can( 'edit_comment', $comment_ID ) ) 1103 1103 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); 1104 1104 1105 1105 do_action('xmlrpc_call', 'wp.deleteComment'); 1106 1106 … … 1136 1136 if ( !current_user_can( 'edit_comment', $comment_ID ) ) 1137 1137 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); 1138 1138 1139 1139 do_action('xmlrpc_call', 'wp.editComment'); 1140 1140 … … 1609 1609 return $attachments_struct; 1610 1610 } 1611 1612 /** 1613 * Retrives a list of post formats used by the site 1614 * 1611 1612 /** 1613 * Retrives a list of post formats used by the site 1614 * 1615 1615 * @since 3.1 1616 * 1617 * @param array $args Method parameters. Contains: 1618 * - blog_id 1619 * - username 1620 * - password 1621 * @return array 1622 */ 1616 * 1617 * @param array $args Method parameters. Contains: 1618 * - blog_id 1619 * - username 1620 * - password 1621 * @return array 1622 */ 1623 1623 function wp_getPostFormats( $args ) { 1624 1624 $this->escape( $args ); … … 1630 1630 if ( !$user = $this->login( $username, $password ) ) 1631 1631 return $this->error; 1632 1632 1633 1633 do_action( 'xmlrpc_call', 'wp.getPostFormats' ); 1634 1634 return get_post_format_strings(); 1635 } 1635 } 1636 1636 1637 1637 /* Blogger API functions. … … 2093 2093 2094 2094 do_action('xmlrpc_call', 'metaWeblog.newPost'); 2095 2095 2096 2096 $page_template = ''; 2097 2097 if ( !empty( $content_struct['post_type'] ) ) { … … 2128 2128 $cap = 'edit_posts'; 2129 2129 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2130 $post_type = 'post'; 2130 $post_type = 'post'; 2131 2131 } 2132 2132 … … 2135 2135 2136 2136 // Check for a valid post format if one was given 2137 if ( isset( $content_struct['wp_post_format'] ) ) { 2138 $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] ); 2137 if ( isset( $content_struct['wp_post_format'] ) ) { 2138 $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] ); 2139 2139 if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) { 2140 2140 return new IXR_Error( 404, __( 'Invalid post format' ) ); … … 2331 2331 2332 2332 $this->attach_uploads( $post_ID, $post_content ); 2333 2333 2334 2334 // Handle post formats if assigned, value is validated earlier 2335 2335 // in this function 2336 2336 if ( isset( $content_struct['wp_post_format'] ) ) 2337 wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); 2337 wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); 2338 2338 2339 2339 logIO('O', "Posted ! ID: $post_ID"); … … 2437 2437 $cap = 'edit_posts'; 2438 2438 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 2439 $post_type = 'post'; 2439 $post_type = 'post'; 2440 2440 } 2441 2441 … … 2444 2444 2445 2445 // Check for a valid post format if one was given 2446 if ( isset( $content_struct['wp_post_format'] ) ) { 2447 $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] ); 2446 if ( isset( $content_struct['wp_post_format'] ) ) { 2447 $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] ); 2448 2448 if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) { 2449 2449 return new IXR_Error( 404, __( 'Invalid post format' ) ); … … 2650 2650 2651 2651 $this->attach_uploads( $ID, $post_content ); 2652 2652 2653 2653 // Handle post formats if assigned, validation is handled 2654 2654 // earlier in this function 2655 2655 if ( isset( $content_struct['wp_post_format'] ) ) 2656 wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); 2656 wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' ); 2657 2657 2658 2658 logIO('O',"(MW) Edited ! ID: $post_ID"); … … 2722 2722 if ( $postdata['post_status'] === 'future' ) 2723 2723 $postdata['post_status'] = 'publish'; 2724 2725 // Get post format 2724 2725 // Get post format 2726 2726 $post_format = get_post_format( $post_ID ); 2727 2727 if ( empty( $post_format ) ) … … 2849 2849 if ( $entry['post_status'] === 'future' ) 2850 2850 $entry['post_status'] = 'publish'; 2851 2852 // Get post format 2851 2852 // Get post format 2853 2853 $post_format = get_post_format( $entry['ID'] ); 2854 2854 if ( empty( $post_format ) )
Note: See TracChangeset
for help on using the changeset viewer.