Changeset 28515
- Timestamp:
- 05/19/2014 06:08:04 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r28453 r28515 34 34 * @return wp_xmlrpc_server 35 35 */ 36 function __construct() {36 public function __construct() { 37 37 $this->methods = array( 38 38 // WordPress API … … 141 141 } 142 142 143 function serve_request() { 143 /** 144 * Make private/protected methods readable for backwards compatibility 145 * 146 * @since 4.0.0 147 * @param string $name 148 * @param array $arguments 149 * @return mixed 150 */ 151 public function __call( $name, $arguments ) { 152 return call_user_func_array( array( $this, $name ), $arguments ); 153 } 154 155 public function serve_request() { 144 156 $this->IXR_Server($this->methods); 145 157 } … … 153 165 * @return string 154 166 */ 155 function sayHello($args) {167 public function sayHello($args) { 156 168 return 'Hello!'; 157 169 } … … 165 177 * @return int 166 178 */ 167 function addTwoNumbers($args) {179 public function addTwoNumbers($args) { 168 180 $number1 = $args[0]; 169 181 $number2 = $args[1]; … … 180 192 * @return mixed WP_User object if authentication passed, false otherwise 181 193 */ 182 function login( $username, $password ) {194 public function login( $username, $password ) { 183 195 /* 184 196 * Respect old get_option() filters left for back-compat when the 'enable_xmlrpc' … … 239 251 * @return bool Whether authentication passed. 240 252 */ 241 function login_pass_ok( $username, $password ) {253 public function login_pass_ok( $username, $password ) { 242 254 return (bool) $this->login( $username, $password ); 243 255 } … … 251 263 * @return string|array Type matches $data and sanitized for the database. 252 264 */ 253 function escape( &$data ) {265 public function escape( &$data ) { 254 266 if ( ! is_array( $data ) ) 255 267 return wp_slash( $data ); … … 271 283 * @return array Custom fields, if exist. 272 284 */ 273 function get_custom_fields($post_id) {285 public function get_custom_fields($post_id) { 274 286 $post_id = (int) $post_id; 275 287 … … 299 311 * @param array $fields Custom fields. 300 312 */ 301 function set_custom_fields($post_id, $fields) {313 public function set_custom_fields($post_id, $fields) { 302 314 $post_id = (int) $post_id; 303 315 … … 329 341 * @since 2.6.0 330 342 */ 331 function initialise_blog_option_info() {343 public function initialise_blog_option_info() { 332 344 global $wp_version; 333 345 … … 498 510 * - 'xmlrpc' - url of xmlrpc endpoint 499 511 */ 500 function wp_getUsersBlogs( $args ) {512 public function wp_getUsersBlogs( $args ) { 501 513 // If this isn't on WPMU then just use blogger_getUsersBlogs 502 514 if ( !is_multisite() ) { … … 1076 1088 * @return string post_id 1077 1089 */ 1078 function wp_newPost( $args ) {1090 public function wp_newPost( $args ) { 1079 1091 if ( ! $this->minimum_args( $args, 4 ) ) 1080 1092 return $this->error; … … 1370 1382 * @return true on success 1371 1383 */ 1372 function wp_editPost( $args ) {1384 public function wp_editPost( $args ) { 1373 1385 if ( ! $this->minimum_args( $args, 5 ) ) 1374 1386 return $this->error; … … 1433 1445 * @return true on success 1434 1446 */ 1435 function wp_deletePost( $args ) {1447 public function wp_deletePost( $args ) { 1436 1448 if ( ! $this->minimum_args( $args, 4 ) ) 1437 1449 return $this->error; … … 1509 1521 * - 'enclosure' 1510 1522 */ 1511 function wp_getPost( $args ) {1523 public function wp_getPost( $args ) { 1512 1524 if ( ! $this->minimum_args( $args, 4 ) ) 1513 1525 return $this->error; … … 1575 1587 * @return array contains a collection of posts. 1576 1588 */ 1577 function wp_getPosts( $args ) {1589 public function wp_getPosts( $args ) { 1578 1590 if ( ! $this->minimum_args( $args, 3 ) ) 1579 1591 return $this->error; … … 1672 1684 * @return string term_id 1673 1685 */ 1674 function wp_newTerm( $args ) {1686 public function wp_newTerm( $args ) { 1675 1687 if ( ! $this->minimum_args( $args, 4 ) ) 1676 1688 return $this->error; … … 1760 1772 * @return bool True, on success. 1761 1773 */ 1762 function wp_editTerm( $args ) {1774 public function wp_editTerm( $args ) { 1763 1775 if ( ! $this->minimum_args( $args, 5 ) ) 1764 1776 return $this->error; … … 1853 1865 * @return boolean|IXR_Error If it suceeded true else a reason why not 1854 1866 */ 1855 function wp_deleteTerm( $args ) {1867 public function wp_deleteTerm( $args ) { 1856 1868 if ( ! $this->minimum_args( $args, 5 ) ) 1857 1869 return $this->error; … … 1921 1933 * - 'count' 1922 1934 */ 1923 function wp_getTerm( $args ) {1935 public function wp_getTerm( $args ) { 1924 1936 if ( ! $this->minimum_args( $args, 5 ) ) 1925 1937 return $this->error; … … 1975 1987 * @return array terms 1976 1988 */ 1977 function wp_getTerms( $args ) {1989 public function wp_getTerms( $args ) { 1978 1990 if ( ! $this->minimum_args( $args, 4 ) ) 1979 1991 return $this->error; … … 2051 2063 * @return array (@see get_taxonomy()) 2052 2064 */ 2053 function wp_getTaxonomy( $args ) {2065 public function wp_getTaxonomy( $args ) { 2054 2066 if ( ! $this->minimum_args( $args, 4 ) ) 2055 2067 return $this->error; … … 2105 2117 * @return array taxonomies 2106 2118 */ 2107 function wp_getTaxonomies( $args ) {2119 public function wp_getTaxonomies( $args ) { 2108 2120 if ( ! $this->minimum_args( $args, 3 ) ) 2109 2121 return $this->error; … … 2177 2189 * - 'roles' 2178 2190 */ 2179 function wp_getUser( $args ) {2191 public function wp_getUser( $args ) { 2180 2192 if ( ! $this->minimum_args( $args, 4 ) ) 2181 2193 return $this->error; … … 2240 2252 * @return array users data 2241 2253 */ 2242 function wp_getUsers( $args ) {2254 public function wp_getUsers( $args ) { 2243 2255 if ( ! $this->minimum_args( $args, 3 ) ) 2244 2256 return $this->error; … … 2311 2323 * @return array (@see wp_getUser) 2312 2324 */ 2313 function wp_getProfile( $args ) {2325 public function wp_getProfile( $args ) { 2314 2326 if ( ! $this->minimum_args( $args, 3 ) ) 2315 2327 return $this->error; … … 2361 2373 * @return bool True, on success. 2362 2374 */ 2363 function wp_editProfile( $args ) {2375 public function wp_editProfile( $args ) { 2364 2376 if ( ! $this->minimum_args( $args, 4 ) ) 2365 2377 return $this->error; … … 2430 2442 * @return array 2431 2443 */ 2432 function wp_getPage($args) {2444 public function wp_getPage($args) { 2433 2445 $this->escape($args); 2434 2446 … … 2474 2486 * @return array 2475 2487 */ 2476 function wp_getPages($args) {2488 public function wp_getPages($args) { 2477 2489 $this->escape($args); 2478 2490 … … 2519 2531 * @return unknown 2520 2532 */ 2521 function wp_newPage($args) {2533 public function wp_newPage($args) { 2522 2534 // Items not escaped here will be escaped in newPost. 2523 2535 $username = $this->escape($args[1]); … … 2547 2559 * @return bool True, if success. 2548 2560 */ 2549 function wp_deletePage($args) {2561 public function wp_deletePage($args) { 2550 2562 $this->escape($args); 2551 2563 … … 2597 2609 * @return unknown 2598 2610 */ 2599 function wp_editPage($args) {2611 public function wp_editPage($args) { 2600 2612 // Items not escaped here will be escaped in editPost. 2601 2613 $blog_id = (int) $args[0]; … … 2645 2657 * @return unknown 2646 2658 */ 2647 function wp_getPageList($args) {2659 public function wp_getPageList($args) { 2648 2660 global $wpdb; 2649 2661 … … 2698 2710 * @return array 2699 2711 */ 2700 function wp_getAuthors($args) {2712 public function wp_getAuthors($args) { 2701 2713 2702 2714 $this->escape($args); … … 2735 2747 * @return array 2736 2748 */ 2737 function wp_getTags( $args ) {2749 public function wp_getTags( $args ) { 2738 2750 $this->escape( $args ); 2739 2751 … … 2777 2789 * @return int Category ID. 2778 2790 */ 2779 function wp_newCategory($args) {2791 public function wp_newCategory($args) { 2780 2792 $this->escape($args); 2781 2793 … … 2847 2859 * @return mixed See {@link wp_delete_term()} for return info. 2848 2860 */ 2849 function wp_deleteCategory($args) {2861 public function wp_deleteCategory($args) { 2850 2862 $this->escape($args); 2851 2863 … … 2889 2901 * @return array 2890 2902 */ 2891 function wp_suggestCategories($args) {2903 public function wp_suggestCategories($args) { 2892 2904 $this->escape($args); 2893 2905 … … 2927 2939 * @return array 2928 2940 */ 2929 function wp_getComment($args) {2941 public function wp_getComment($args) { 2930 2942 $this->escape($args); 2931 2943 … … 2969 2981 * @return array. Contains a collection of comments. See {@link wp_xmlrpc_server::wp_getComment()} for a description of each item contents 2970 2982 */ 2971 function wp_getComments($args) {2983 public function wp_getComments($args) { 2972 2984 $this->escape($args); 2973 2985 … … 3030 3042 * @return mixed {@link wp_delete_comment()} 3031 3043 */ 3032 function wp_deleteComment($args) {3044 public function wp_deleteComment($args) { 3033 3045 $this->escape($args); 3034 3046 … … 3094 3106 * @return bool True, on success. 3095 3107 */ 3096 function wp_editComment($args) {3108 public function wp_editComment($args) { 3097 3109 $this->escape($args); 3098 3110 … … 3178 3190 * @return mixed {@link wp_new_comment()} 3179 3191 */ 3180 function wp_newComment($args) {3192 public function wp_newComment($args) { 3181 3193 global $wpdb; 3182 3194 … … 3282 3294 * @return array 3283 3295 */ 3284 function wp_getCommentStatusList($args) {3296 public function wp_getCommentStatusList($args) { 3285 3297 $this->escape( $args ); 3286 3298 … … 3309 3321 * @return array 3310 3322 */ 3311 function wp_getCommentCount( $args ) {3323 public function wp_getCommentCount( $args ) { 3312 3324 $this->escape($args); 3313 3325 … … 3343 3355 * @return array 3344 3356 */ 3345 function wp_getPostStatusList( $args ) {3357 public function wp_getPostStatusList( $args ) { 3346 3358 $this->escape( $args ); 3347 3359 … … 3370 3382 * @return array 3371 3383 */ 3372 function wp_getPageStatusList( $args ) {3384 public function wp_getPageStatusList( $args ) { 3373 3385 $this->escape( $args ); 3374 3386 … … 3397 3409 * @return array 3398 3410 */ 3399 function wp_getPageTemplates( $args ) {3411 public function wp_getPageTemplates( $args ) { 3400 3412 $this->escape( $args ); 3401 3413 … … 3424 3436 * @return array 3425 3437 */ 3426 function wp_getOptions( $args ) {3438 public function wp_getOptions( $args ) { 3427 3439 $this->escape( $args ); 3428 3440 … … 3450 3462 * @return array 3451 3463 */ 3452 function _getOptions($options) {3464 public function _getOptions($options) { 3453 3465 $data = array(); 3454 3466 $can_manage = current_user_can( 'manage_options' ); … … 3478 3490 * @return unknown 3479 3491 */ 3480 function wp_setOptions( $args ) {3492 public function wp_setOptions( $args ) { 3481 3493 $this->escape( $args ); 3482 3494 … … 3527 3539 * - 'metadata' 3528 3540 */ 3529 function wp_getMediaItem($args) {3541 public function wp_getMediaItem($args) { 3530 3542 $this->escape($args); 3531 3543 … … 3573 3585 * @return array. Contains a collection of media items. See {@link wp_xmlrpc_server::wp_getMediaItem()} for a description of each item contents 3574 3586 */ 3575 function wp_getMediaLibrary($args) {3587 public function wp_getMediaLibrary($args) { 3576 3588 $this->escape($args); 3577 3589 … … 3616 3628 * @return array 3617 3629 */ 3618 function wp_getPostFormats( $args ) {3630 public function wp_getPostFormats( $args ) { 3619 3631 $this->escape( $args ); 3620 3632 … … 3674 3686 * - 'supports' 3675 3687 */ 3676 function wp_getPostType( $args ) {3688 public function wp_getPostType( $args ) { 3677 3689 if ( ! $this->minimum_args( $args, 4 ) ) 3678 3690 return $this->error; … … 3730 3742 * @return array 3731 3743 */ 3732 function wp_getPostTypes( $args ) {3744 public function wp_getPostTypes( $args ) { 3733 3745 if ( ! $this->minimum_args( $args, 3 ) ) 3734 3746 return $this->error; … … 3787 3799 * @return array contains a collection of posts. 3788 3800 */ 3789 function wp_getRevisions( $args ) {3801 public function wp_getRevisions( $args ) { 3790 3802 if ( ! $this->minimum_args( $args, 4 ) ) 3791 3803 return $this->error; … … 3863 3875 * @return bool false if there was an error restoring, true if success. 3864 3876 */ 3865 function wp_restoreRevision( $args ) {3877 public function wp_restoreRevision( $args ) { 3866 3878 if ( ! $this->minimum_args( $args, 3 ) ) 3867 3879 return $this->error; … … 3915 3927 * @return array 3916 3928 */ 3917 function blogger_getUsersBlogs($args) {3929 public function blogger_getUsersBlogs($args) { 3918 3930 if ( is_multisite() ) 3919 3931 return $this->_multisite_getUsersBlogs($args); … … 3948 3960 * @access protected 3949 3961 */ 3950 function _multisite_getUsersBlogs($args) {3962 protected function _multisite_getUsersBlogs($args) { 3951 3963 $current_blog = get_blog_details(); 3952 3964 … … 3982 3994 * @return array 3983 3995 */ 3984 function blogger_getUserInfo($args) {3996 public function blogger_getUserInfo($args) { 3985 3997 3986 3998 $this->escape($args); … … 4017 4029 * @return array 4018 4030 */ 4019 function blogger_getPost($args) {4031 public function blogger_getPost($args) { 4020 4032 4021 4033 $this->escape($args); … … 4062 4074 * @return array 4063 4075 */ 4064 function blogger_getRecentPosts($args) {4076 public function blogger_getRecentPosts($args) { 4065 4077 4066 4078 $this->escape($args); … … 4125 4137 * @deprecated 3.5.0 4126 4138 */ 4127 function blogger_getTemplate($args) {4139 public function blogger_getTemplate($args) { 4128 4140 return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) ); 4129 4141 } … … 4135 4147 * @deprecated 3.5.0 4136 4148 */ 4137 function blogger_setTemplate($args) {4149 public function blogger_setTemplate($args) { 4138 4150 return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) ); 4139 4151 } … … 4147 4159 * @return int 4148 4160 */ 4149 function blogger_newPost($args) {4161 public function blogger_newPost($args) { 4150 4162 4151 4163 $this->escape($args); … … 4210 4222 * @return bool true when done. 4211 4223 */ 4212 function blogger_editPost( $args ) {4224 public function blogger_editPost( $args ) { 4213 4225 4214 4226 $this->escape($args); … … 4278 4290 * @return bool True when post is deleted. 4279 4291 */ 4280 function blogger_deletePost($args) {4292 public function blogger_deletePost($args) { 4281 4293 $this->escape($args); 4282 4294 … … 4357 4369 * @return int 4358 4370 */ 4359 function mw_newPost($args) {4371 public function mw_newPost($args) { 4360 4372 $this->escape($args); 4361 4373 … … 4637 4649 } 4638 4650 4639 function add_enclosure_if_new( $post_ID, $enclosure ) {4651 public function add_enclosure_if_new( $post_ID, $enclosure ) { 4640 4652 if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 4641 4653 $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n"; … … 4663 4675 * @param string $post_content Post Content for attachment. 4664 4676 */ 4665 function attach_uploads( $post_ID, $post_content ) {4677 public function attach_uploads( $post_ID, $post_content ) { 4666 4678 global $wpdb; 4667 4679 … … 4684 4696 * @return bool True on success. 4685 4697 */ 4686 function mw_editPost($args) {4698 public function mw_editPost($args) { 4687 4699 4688 4700 $this->escape($args); … … 4971 4983 * @return array 4972 4984 */ 4973 function mw_getPost($args) {4985 public function mw_getPost($args) { 4974 4986 4975 4987 $this->escape($args); … … 5096 5108 * @return array 5097 5109 */ 5098 function mw_getRecentPosts($args) {5110 public function mw_getRecentPosts($args) { 5099 5111 5100 5112 $this->escape($args); … … 5216 5228 * @return array 5217 5229 */ 5218 function mw_getCategories($args) {5230 public function mw_getCategories($args) { 5219 5231 5220 5232 $this->escape($args); … … 5264 5276 * @return array 5265 5277 */ 5266 function mw_newMediaObject($args) {5278 public function mw_newMediaObject($args) { 5267 5279 global $wpdb; 5268 5280 … … 5378 5390 * @return array 5379 5391 */ 5380 function mt_getRecentPostTitles($args) {5392 public function mt_getRecentPostTitles($args) { 5381 5393 5382 5394 $this->escape($args); … … 5439 5451 * @return array 5440 5452 */ 5441 function mt_getCategoryList($args) {5453 public function mt_getCategoryList($args) { 5442 5454 5443 5455 $this->escape($args); … … 5478 5490 * @return array 5479 5491 */ 5480 function mt_getPostCategories($args) {5492 public function mt_getPostCategories($args) { 5481 5493 5482 5494 $this->escape($args); … … 5522 5534 * @return bool True on success. 5523 5535 */ 5524 function mt_setPostCategories($args) {5536 public function mt_setPostCategories($args) { 5525 5537 5526 5538 $this->escape($args); … … 5561 5573 * @return array 5562 5574 */ 5563 function mt_supportedMethods($args) {5575 public function mt_supportedMethods($args) { 5564 5576 5565 5577 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 5581 5593 * @param array $args Method parameters. 5582 5594 */ 5583 function mt_supportedTextFilters($args) {5595 public function mt_supportedTextFilters($args) { 5584 5596 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5585 5597 do_action( 'xmlrpc_call', 'mt.supportedTextFilters' ); … … 5603 5615 * @return mixed 5604 5616 */ 5605 function mt_getTrackbackPings($args) {5617 public function mt_getTrackbackPings($args) { 5606 5618 5607 5619 global $wpdb; … … 5646 5658 * @return int 5647 5659 */ 5648 function mt_publishPost($args) {5660 public function mt_publishPost($args) { 5649 5661 5650 5662 $this->escape($args); … … 5691 5703 * @return array 5692 5704 */ 5693 function pingback_ping($args) {5705 public function pingback_ping($args) { 5694 5706 global $wpdb; 5695 5707 … … 5904 5916 * @return array 5905 5917 */ 5906 function pingback_extensions_getPingbacks($args) {5918 public function pingback_extensions_getPingbacks($args) { 5907 5919 5908 5920 global $wpdb;
Note: See TracChangeset
for help on using the changeset viewer.