Changeset 6594
- Timestamp:
- 01/10/2008 09:46:25 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r6593 r6594 259 259 260 260 return false; 261 } 262 263 /** 264 * get_post_statuses( ) - Retuns the possible user post status values 265 * 266 * Posts have a limited set of valid status values, this provides the 267 * post_status values and descriptions. 268 * 269 * @package WordPress 270 * @subpackage Post 271 * @since 2.4 272 * 273 * @return array 274 */ 275 function get_post_statuses( ) { 276 $status = array( 277 'draft' => __('Draft'), 278 'pending' => __('Pending Review'), 279 'private' => __('Private'), 280 'publish' => __('Published') 281 ); 282 283 return $status; 284 } 285 286 /** 287 * get_page_statuses( ) - Retuns the possible user page status values 288 * 289 * Pages have a limited set of valid status values, this provides the 290 * post_status values and descriptions. 291 * 292 * @package WordPress 293 * @subpackage Page 294 * @since 2.4 295 * 296 * @return array 297 */ 298 function get_page_statuses( ) { 299 $status = array( 300 'draft' => __('Draft'), 301 'private' => __('Private'), 302 'publish' => __('Published') 303 ); 304 305 return $status; 261 306 } 262 307 -
trunk/xmlrpc.php
r6534 r6594 89 89 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias 90 90 'wp.getCommentCount' => 'this:wp_getCommentCount', 91 'wp.getPostStatusList' => 'this:wp_getPostStatusList', 92 'wp.getPageStatusList' => 'this:wp_getPageStatusList', 91 93 92 94 // Blogger API … … 699 701 700 702 703 function wp_getPostStatusList( $args ) { 704 $this->escape( $args ); 705 706 $blog_id = (int) $args[0]; 707 $username = $args[1]; 708 $password = $args[2]; 709 710 if( !$this->login_pass_ok( $username, $password ) ) { 711 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) ); 712 } 713 714 set_current_user( 0, $username ); 715 if( !current_user_can( 'edit_posts' ) ) { 716 return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); 717 } 718 719 return get_post_statuses( ); 720 } 721 722 723 function wp_getPageStatusList( $args ) { 724 $this->escape( $args ); 725 726 $blog_id = (int) $args[0]; 727 $username = $args[1]; 728 $password = $args[2]; 729 730 if( !$this->login_pass_ok( $username, $password ) ) { 731 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) ); 732 } 733 734 set_current_user( 0, $username ); 735 if( !current_user_can( 'edit_posts' ) ) { 736 return new IXR_Error( 403, __( 'You are not allowed acces to details about this blog.' ) ); 737 } 738 739 return get_page_statuses( ); 740 } 741 742 701 743 /* Blogger API functions 702 744 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/ … … 1148 1190 $post_title = $content_struct['title']; 1149 1191 $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); 1192 1150 1193 $post_status = $publish ? 'publish' : 'draft'; 1194 if( isset( $content_struct['post_status'] ) ) { 1195 switch( $content_struct['post_status'] ) { 1196 case 'draft': 1197 case 'private': 1198 case 'publish': 1199 $post_status = $content_struct['post_status']; 1200 break; 1201 case 'pending': 1202 // Pending is only valid for posts, not pages. 1203 if( $post_type === 'post' ) { 1204 $post_status = $content_struct['post_status']; 1205 } 1206 break; 1207 default: 1208 $post_status = $publish ? 'publish' : 'draft'; 1209 break; 1210 } 1211 } 1151 1212 1152 1213 $post_excerpt = $content_struct['mt_excerpt']; … … 1448 1509 $post_excerpt = $content_struct['mt_excerpt']; 1449 1510 $post_more = $content_struct['mt_text_more']; 1511 1450 1512 $post_status = $publish ? 'publish' : 'draft'; 1513 if( isset( $content_struct['post_status'] ) ) { 1514 switch( $content_struct['post_status'] ) { 1515 case 'draft': 1516 case 'private': 1517 case 'publish': 1518 $post_status = $content_struct['post_status']; 1519 break; 1520 case 'pending': 1521 // Pending is only valid for posts, not pages. 1522 if( $post_type === 'post' ) { 1523 $post_status = $content_struct['post_status']; 1524 } 1525 break; 1526 default: 1527 $post_status = $publish ? 'publish' : 'draft'; 1528 break; 1529 } 1530 } 1451 1531 1452 1532 $tags_input = $content_struct['mt_keywords']; … … 1546 1626 $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0; 1547 1627 $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0; 1628 1629 // Consider future posts as published 1630 if( $postdata['post_status'] === 'future' ) { 1631 $postdata['post_status'] = 'publish'; 1632 } 1548 1633 1549 1634 $resp = array( … … 1636 1721 $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0; 1637 1722 $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0; 1723 1724 // Consider future posts as published 1725 if( $entry['post_status'] === 'future' ) { 1726 $entry['post_status'] = 'publish'; 1727 } 1638 1728 1639 1729 $struct[] = array(
Note: See TracChangeset
for help on using the changeset viewer.