Changeset 32550
- Timestamp:
- 05/22/2015 07:36:22 PM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r32547 r32550 404 404 'Name', 'Version', 'Status', 'Title', 'Author', 'Author Name', 'Author URI', 'Description', 405 405 'Template', 'Stylesheet', 'Template Files', 'Stylesheet Files', 'Template Dir', 'Stylesheet Dir', 406 406 'Screenshot', 'Tags', 'Theme Root', 'Theme Root URI', 'Parent Theme', 407 407 ); 408 408 -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r32477 r32550 159 159 * @param callable $name Method to call. 160 160 * @param array $arguments Arguments to pass when calling. 161 * @return mixed|boolReturn value of the callback, false otherwise.161 * @return array|IXR_Error|false Return value of the callback, false otherwise. 162 162 */ 163 163 public function __call( $name, $arguments ) { … … 177 177 * @since 1.5.0 178 178 * 179 * @param array $args Method Parameters.180 179 * @return string 181 180 */ 182 public function sayHello( $args) {181 public function sayHello() { 183 182 return 'Hello!'; 184 183 } … … 189 188 * @since 1.5.0 190 189 * 191 * @param array $args Method Parameters. 190 * @param array $args { 191 * Method parameters. 192 * 193 * @type int $number1 A number to add. 194 * @type int $number2 A second number to add. 195 * } 192 196 * @return int 193 197 */ 194 public function addTwoNumbers( $args) {198 public function addTwoNumbers( $args ) { 195 199 $number1 = $args[0]; 196 200 $number2 = $args[1]; … … 276 280 * 277 281 * @param string|array $data Escape single string or array of strings. 278 * @return string|array Type matches $data and sanitized for the database. 282 * @return string|null Returns with string is passed, alters by-reference 283 * when array is passed. 279 284 */ 280 285 public function escape( &$data ) { … … 355 360 * 356 361 * @since 2.6.0 362 * 363 * @global string $wp_version 357 364 */ 358 365 public function initialise_blog_option_info() { … … 515 522 * @since 2.6.0 516 523 * 517 * @param array $args Method parameters. Contains: 518 * - username 519 * - password 524 * @param array $args { 525 * Method parameters, in this order: 526 * 527 * @type string $username 528 * @type string $password 529 * } 520 530 * @return array|IXR_Error Array contains: 521 531 * - 'isAdmin' … … 588 598 * @param string|array $args Sanitize single string or array of strings. 589 599 * @param int $count Minimum number of arguments. 590 * @return bool eanif $args contains at least $count arguments.600 * @return bool if $args contains at least $count arguments. 591 601 */ 592 602 protected function minimum_args( $args, $count ) { … … 652 662 protected function _prepare_term( $term ) { 653 663 $_term = $term; 654 if ( ! is_array( $_term ) )664 if ( ! is_array( $_term ) ) 655 665 $_term = get_object_vars( $_term ); 656 666 … … 1078 1088 * @since 3.4.0 1079 1089 * 1080 * @param array $args Method parameters. Contains: 1081 * - int $blog_id (unused) 1082 * - string $username 1083 * - string $password 1084 * - array $content_struct 1085 * $content_struct can contain: 1090 * @param array $args { 1091 * Method parameters, in this order: 1092 * 1093 * @type int $blog_id (unused) 1094 * @type string $username 1095 * @type string $password 1096 * @type array $content_struct can contain: 1086 1097 * - post_type (default: 'post') 1087 1098 * - post_status (default: 'draft') … … 1102 1113 * - enclosure 1103 1114 * - any other fields supported by wp_insert_post() 1115 * } 1104 1116 * @return string|IXR_Error post_id 1105 1117 */ … … 1159 1171 * @param WP_User $user The post author if post_author isn't set in $content_struct. 1160 1172 * @param array|IXR_Error $content_struct Post data to insert. 1173 * @return IXR_Error|string 1161 1174 */ 1162 1175 protected function _insert_post( $user, $content_struct ) { … … 1404 1417 * @since 3.4.0 1405 1418 * 1406 * @param array $args Method parameters. Contains: 1407 * - int $blog_id (unused) 1408 * - string $username 1409 * - string $password 1410 * - int $post_id 1411 * - array $content_struct 1412 * @return bool|IXR_Error true on success 1419 * @param array $args { 1420 * Method parameters, in this order: 1421 * 1422 * @type int $blog_id (unused) 1423 * @type string $username 1424 * @type string $password 1425 * @type int $post_id 1426 * @type array $content_struct 1427 * } 1428 * @return true|IXR_Error true on success 1413 1429 */ 1414 1430 public function wp_editPost( $args ) { … … 1467 1483 * 1468 1484 * @uses wp_delete_post() 1469 * @param array $args Method parameters. Contains: 1470 * - int $blog_id (unused) 1471 * - string $username 1472 * - string $password 1473 * - int $post_id 1474 * @return bool|IXR_Error true on success 1485 * 1486 * @param array $args { 1487 * Method parameters, in this order: 1488 * 1489 * @type int $blog_id (unused) 1490 * @type string $username 1491 * @type string $password 1492 * @type int $post_id 1493 * } 1494 * @return true|IXR_Error true on success 1475 1495 */ 1476 1496 public function wp_deletePost( $args ) { … … 1556 1576 $this->escape( $args ); 1557 1577 1558 $username 1559 $password 1560 $post_id 1578 $username = $args[1]; 1579 $password = $args[2]; 1580 $post_id = (int) $args[3]; 1561 1581 1562 1582 if ( isset( $args[4] ) ) { … … 1621 1641 $this->escape( $args ); 1622 1642 1623 $username 1624 $password 1625 $filter 1643 $username = $args[1]; 1644 $password = $args[2]; 1645 $filter = isset( $args[3] ) ? $args[3] : array(); 1626 1646 1627 1647 if ( isset( $args[4] ) ) { … … 1717 1737 $this->escape( $args ); 1718 1738 1719 $username 1720 $password 1721 $content_struct 1739 $username = $args[1]; 1740 $password = $args[2]; 1741 $content_struct = $args[3]; 1722 1742 1723 1743 if ( ! $user = $this->login( $username, $password ) ) … … 1796 1816 * - 'description' 1797 1817 * - 'slug' 1798 * @return bool|IXR_Error True, on success.1818 * @return true|IXR_Error True, on success. 1799 1819 */ 1800 1820 public function wp_editTerm( $args ) { … … 1804 1824 $this->escape( $args ); 1805 1825 1806 $username 1807 $password 1808 $term_id 1809 $content_struct 1826 $username = $args[1]; 1827 $password = $args[2]; 1828 $term_id = (int) $args[3]; 1829 $content_struct = $args[4]; 1810 1830 1811 1831 if ( ! $user = $this->login( $username, $password ) ) … … 1882 1902 * 1883 1903 * @uses wp_delete_term() 1884 * @param array $args Method parameters. Contains: 1885 * - int $blog_id (unused) 1886 * - string $username 1887 * - string $password 1888 * - string $taxnomy_name 1889 * - string $term_id 1890 * @return boolean|IXR_Error If it suceeded true else a reason why not 1904 * 1905 * @param array $args { 1906 * Method parameters, in this order: 1907 * 1908 * @type int $blog_id (unused) 1909 * @type string $username 1910 * @type string $password 1911 * @type string $taxnomy_name 1912 * @type string $term_id 1913 * } 1914 * @return bool|IXR_Error If it suceeded true else a reason why not 1891 1915 */ 1892 1916 public function wp_deleteTerm( $args ) { … … 1940 1964 * 1941 1965 * @uses get_term() 1942 * @param array $args Method parameters. Contains: 1943 * - int $blog_id (unused) 1944 * - string $username 1945 * - string $password 1946 * - string $taxonomy 1947 * - string $term_id 1966 * 1967 * @param array $args { 1968 * Method parameters, in this order: 1969 * 1970 * @type int $blog_id (unused) 1971 * @type string $username 1972 * @type string $password 1973 * @type string $taxnomy 1974 * @type string $term_id 1975 * } 1948 1976 * @return array|IXR_Error Array contains: 1949 1977 * - 'term_id' … … 2002 2030 * 2003 2031 * @uses get_terms() 2004 * @param array $args Method parameters. Contains: 2005 * - int $blog_id (unused) 2006 * - string $username 2007 * - string $password 2008 * - string $taxonomy 2009 * - array $filter optional 2032 * 2033 * @param array $args { 2034 * Method parameters, in this order: 2035 * 2036 * @type int $blog_id (unused) 2037 * @type string $username 2038 * @type string $password 2039 * @type string $taxnomy 2040 * @type array $filter (optional) 2041 * } 2010 2042 * @return array|IXR_Error terms 2011 2043 */ … … 2078 2110 * 2079 2111 * @uses get_taxonomy() 2080 * @param array $args Method parameters. Contains: 2081 * - int $blog_id (unused) 2082 * - string $username 2083 * - string $password 2084 * - string $taxonomy 2112 * 2113 * @param array $args { 2114 * Method parameters, in this order: 2115 * 2116 * @type int $blog_id (unused) 2117 * @type string $username 2118 * @type string $password 2119 * @type string $taxnomy 2120 * @type array $fields (optional) 2121 * } 2085 2122 * @return array|IXR_Error (@see get_taxonomy()) 2086 2123 */ … … 2091 2128 $this->escape( $args ); 2092 2129 2093 $username 2094 $password 2095 $taxonomy 2130 $username = $args[1]; 2131 $password = $args[2]; 2132 $taxonomy = $args[3]; 2096 2133 2097 2134 if ( isset( $args[4] ) ) { … … 2132 2169 * 2133 2170 * @uses get_taxonomies() 2134 * @param array $args Method parameters. Contains: 2135 * - int $blog_id (unused) 2136 * - string $username 2137 * - string $password 2171 * 2172 * @param array $args { 2173 * Method parameters, in this order: 2174 * 2175 * @type int $blog_id (unused) 2176 * @type string $username 2177 * @type string $password 2178 * } 2138 2179 * @return array taxonomies 2139 2180 */ … … 2144 2185 $this->escape( $args ); 2145 2186 2146 $username 2147 $password 2148 $filter 2187 $username = $args[1]; 2188 $password = $args[2]; 2189 $filter = isset( $args[3] ) ? $args[3] : array( 'public' => true ); 2149 2190 2150 2191 if ( isset( $args[4] ) ) { … … 2189 2230 * 2190 2231 * @uses get_userdata() 2191 * @param array $args Method parameters. Contains: 2192 * - int $blog_id (unused) 2193 * - string $username 2194 * - string $password 2195 * - int $user_id 2196 * - array $fields optional 2232 * 2233 * @param array $args { 2234 * Method parameters, in this order: 2235 * 2236 * @type int $blog_id (unused) 2237 * @type string $username 2238 * @type string $password 2239 * @type int $user_id 2240 * @type array $fields (optional) 2241 * } 2197 2242 * @return array|IXR_Error Array contains (based on $fields parameter): 2198 2243 * - 'user_id' … … 2215 2260 $this->escape( $args ); 2216 2261 2217 $username 2218 $password 2219 $user_id 2262 $username = $args[1]; 2263 $password = $args[2]; 2264 $user_id = (int) $args[3]; 2220 2265 2221 2266 if ( isset( $args[4] ) ) { … … 2263 2308 * @see wp_getUser() for more on $fields and return values 2264 2309 * 2265 * @param array $args Method parameters. Contains: 2266 * - int $blog_id (unused) 2267 * - string $username 2268 * - string $password 2269 * - array $filter optional 2270 * - array $fields optional 2310 * @param array $args { 2311 * Method parameters, in this order: 2312 * 2313 * @type int $blog_id (unused) 2314 * @type string $username 2315 * @type string $password 2316 * @type array $filter (optional) 2317 * @type array $fields (optional) 2318 * } 2271 2319 * @return array|IXR_Error users data 2272 2320 */ … … 2277 2325 $this->escape( $args ); 2278 2326 2279 $username 2280 $password 2281 $filter 2327 $username = $args[1]; 2328 $password = $args[2]; 2329 $filter = isset( $args[3] ) ? $args[3] : array(); 2282 2330 2283 2331 if ( isset( $args[4] ) ) { … … 2334 2382 * 2335 2383 * @uses get_userdata() 2336 * @param array $args Method parameters. Contains: 2337 * - int $blog_id (unused) 2338 * - string $username 2339 * - string $password 2340 * - array $fields optional 2384 * 2385 * @param array $args { 2386 * Method parameters, in this order: 2387 * 2388 * @type int $blog_id (unused) 2389 * @type string $username 2390 * @type string $password 2391 * @type array $fields (optional) 2392 * } 2341 2393 * @return array|IXR_Error (@see wp_getUser) 2342 2394 */ … … 2347 2399 $this->escape( $args ); 2348 2400 2349 $username 2350 $password 2401 $username = $args[1]; 2402 $password = $args[2]; 2351 2403 2352 2404 if ( isset( $args[3] ) ) { … … 2375 2427 * 2376 2428 * @uses wp_update_user() 2377 * @param array $args Method parameters. Contains: 2378 * - int $blog_id (unused) 2379 * - string $username 2380 * - string $password 2381 * - array $content_struct 2382 * It can optionally contain: 2429 * 2430 * @param array $args { 2431 * Method parameters, in this order: 2432 * 2433 * @type int $blog_id (unused) 2434 * @type string $username 2435 * @type string $password 2436 * @type array $content_struct It can optionally contain: 2383 2437 * - 'first_name' 2384 2438 * - 'last_name' … … 2388 2442 * - 'nicename' 2389 2443 * - 'bio' 2390 * @return bool|IXR_Error True, on success. 2444 * } 2445 * @return true|IXR_Error True, on success. 2391 2446 */ 2392 2447 public function wp_editProfile( $args ) { … … 2451 2506 * @since 2.2.0 2452 2507 * 2453 * @param array $args Method parameters. Contains: 2454 * - blog_id (unused) 2455 * - page_id 2456 * - username 2457 * - password 2508 * @param array $args { 2509 * Method parameters, in this order: 2510 * 2511 * @type int $blog_id (unused) 2512 * @type int $page_id 2513 * @type string $username 2514 * @type string $password 2515 * } 2458 2516 * @return array|IXR_Error 2459 2517 */ 2460 public function wp_getPage( $args) {2461 $this->escape( $args);2462 2463 $page_id 2464 $username 2465 $password 2518 public function wp_getPage( $args ) { 2519 $this->escape( $args ); 2520 2521 $page_id = (int) $args[1]; 2522 $username = $args[2]; 2523 $password = $args[3]; 2466 2524 2467 2525 if ( !$user = $this->login($username, $password) ) { … … 2494 2552 * @since 2.2.0 2495 2553 * 2496 * @param array $args Method parameters. Contains: 2497 * - blog_id (unused) 2498 * - username 2499 * - password 2500 * - num_pages 2554 * @param array $args { 2555 * Method parameters, in this order: 2556 * 2557 * @type int $blog_id (unused) 2558 * @type string $username 2559 * @type string $password 2560 * @type int $num_pages 2561 * } 2501 2562 * @return array|IXR_Error 2502 2563 */ 2503 public function wp_getPages( $args) {2504 $this->escape( $args);2505 2506 $username 2507 $password 2508 $num_pages 2564 public function wp_getPages( $args ) { 2565 $this->escape( $args ); 2566 2567 $username = $args[1]; 2568 $password = $args[2]; 2569 $num_pages = isset($args[3]) ? (int) $args[3] : 10; 2509 2570 2510 2571 if ( !$user = $this->login($username, $password) ) … … 2540 2601 * @since 2.2.0 2541 2602 * 2542 * @param array $args Method parameters. See {@link wp_xmlrpc_server::mw_newPost()} 2603 * @param array $args { 2604 * See {@link wp_xmlrpc_server::mw_newPost()} 2605 * Method parameters, in this order: 2606 * 2607 * @type int $blog_id (unused) 2608 * @type string $username 2609 * @type string $password 2610 * @type array $content_struct 2611 * } 2543 2612 * @return int|IXR_Error 2544 2613 */ 2545 public function wp_newPage( $args) {2614 public function wp_newPage( $args ) { 2546 2615 // Items not escaped here will be escaped in newPost. 2547 $username = $this->escape($args[1]);2548 $password = $this->escape($args[2]);2616 $username = $this->escape( $args[1] ); 2617 $password = $this->escape( $args[2] ); 2549 2618 2550 2619 if ( !$user = $this->login($username, $password) ) … … 2566 2635 * @since 2.2.0 2567 2636 * 2568 * @param array $args Method parameters. 2569 * @return bool|IXR_Error True, if success. 2570 */ 2571 public function wp_deletePage($args) { 2572 $this->escape($args); 2573 2574 $username = $args[1]; 2575 $password = $args[2]; 2576 $page_id = (int) $args[3]; 2637 * @param array $args { 2638 * Method parameters, in this order: 2639 * 2640 * @type int $blog_id (unused) 2641 * @type string $username 2642 * @type string $password 2643 * @type int $page_id 2644 * } 2645 * @return true|IXR_Error True, if success. 2646 */ 2647 public function wp_deletePage( $args ) { 2648 $this->escape( $args ); 2649 2650 $username = $args[1]; 2651 $password = $args[2]; 2652 $page_id = (int) $args[3]; 2577 2653 2578 2654 if ( !$user = $this->login($username, $password) ) … … 2615 2691 * @since 2.2.0 2616 2692 * 2617 * @param array $args Method parameters. 2693 * @param array $args { 2694 * Method parameters, in this order: 2695 * 2696 * @type int $blog_id (unused) 2697 * @type int $page_id 2698 * @type string $username 2699 * @type string $password 2700 * @type string $content 2701 * @type string $publish 2702 * } 2618 2703 * @return array|IXR_Error 2619 2704 */ 2620 public function wp_editPage( $args) {2705 public function wp_editPage( $args ) { 2621 2706 // Items not escaped here will be escaped in editPost. 2622 $page_id 2623 $username 2624 $password 2625 $content 2626 $publish 2707 $page_id = (int) $this->escape($args[1]); 2708 $username = $this->escape($args[2]); 2709 $password = $this->escape($args[3]); 2710 $content = $args[4]; 2711 $publish = $args[5]; 2627 2712 2628 2713 if ( !$user = $this->login($username, $password) ) … … 2662 2747 * @since 2.2.0 2663 2748 * 2664 * @param array $args Method parameters. 2749 * @global wpdb $wpdb 2750 * 2751 * @param array $args { 2752 * Method parameters, in this order: 2753 * 2754 * @type int $blog_id (unused) 2755 * @type string $username 2756 * @type string $password 2757 * } 2665 2758 * @return array|IXR_Error 2666 2759 */ 2667 public function wp_getPageList( $args) {2760 public function wp_getPageList( $args ) { 2668 2761 global $wpdb; 2669 2762 2670 $this->escape( $args);2671 2672 $username 2673 $password 2763 $this->escape( $args ); 2764 2765 $username = $args[1]; 2766 $password = $args[2]; 2674 2767 2675 2768 if ( !$user = $this->login($username, $password) ) … … 2714 2807 * @since 2.2.0 2715 2808 * 2716 * @param array $args Method parameters. 2809 * @param array $args { 2810 * Method parameters, in this order: 2811 * 2812 * @type int $blog_id (unused) 2813 * @type string $username 2814 * @type string $password 2815 * } 2717 2816 * @return array|IXR_Error 2718 2817 */ 2719 public function wp_getAuthors($args) { 2720 2721 $this->escape($args); 2722 2723 $username = $args[1]; 2724 $password = $args[2]; 2818 public function wp_getAuthors( $args ) { 2819 $this->escape( $args ); 2820 2821 $username = $args[1]; 2822 $password = $args[2]; 2725 2823 2726 2824 if ( !$user = $this->login($username, $password) ) … … 2750 2848 * @since 2.7.0 2751 2849 * 2752 * @param array $args Method parameters. 2850 * @param array $args { 2851 * Method parameters, in this order: 2852 * 2853 * @type int $blog_id (unused) 2854 * @type string $username 2855 * @type string $password 2856 * } 2753 2857 * @return array|IXR_Error 2754 2858 */ … … 2756 2860 $this->escape( $args ); 2757 2861 2758 $username 2759 $password 2862 $username = $args[1]; 2863 $password = $args[2]; 2760 2864 2761 2865 if ( !$user = $this->login($username, $password) ) … … 2792 2896 * @since 2.2.0 2793 2897 * 2794 * @param array $args Method parameters. 2898 * @param array $args { 2899 * Method parameters, in this order: 2900 * 2901 * @type int $blog_id (unused) 2902 * @type string $username 2903 * @type string $password 2904 * @type array $category 2905 * } 2795 2906 * @return int|IXR_Error Category ID. 2796 2907 */ 2797 public function wp_newCategory( $args) {2798 $this->escape( $args);2799 2800 $username 2801 $password 2802 $category 2908 public function wp_newCategory( $args ) { 2909 $this->escape( $args ); 2910 2911 $username = $args[1]; 2912 $password = $args[2]; 2913 $category = $args[3]; 2803 2914 2804 2915 if ( !$user = $this->login($username, $password) ) … … 2861 2972 * @since 2.5.0 2862 2973 * 2863 * @param array $args Method parameters. 2974 * @param array $args { 2975 * Method parameters, in this order: 2976 * 2977 * @type int $blog_id (unused) 2978 * @type string $username 2979 * @type string $password 2980 * @type int $category_id 2981 * } 2864 2982 * @return bool|IXR_Error See {@link wp_delete_term()} for return info. 2865 2983 */ 2866 public function wp_deleteCategory( $args) {2867 $this->escape( $args);2868 2869 $username 2870 $password 2871 $category_id 2984 public function wp_deleteCategory( $args ) { 2985 $this->escape( $args ); 2986 2987 $username = $args[1]; 2988 $password = $args[2]; 2989 $category_id = (int) $args[3]; 2872 2990 2873 2991 if ( !$user = $this->login($username, $password) ) … … 2902 3020 * @since 2.2.0 2903 3021 * 2904 * @param array $args Method parameters. 3022 * @param array $args { 3023 * Method parameters, in this order: 3024 * 3025 * @type int $blog_id (unused) 3026 * @type string $username 3027 * @type string $password 3028 * @type array $category 3029 * @type int $max_results 3030 * } 2905 3031 * @return array|IXR_Error 2906 3032 */ 2907 public function wp_suggestCategories( $args) {2908 $this->escape( $args);2909 2910 $username 2911 $password 2912 $category 2913 $max_results 3033 public function wp_suggestCategories( $args ) { 3034 $this->escape( $args ); 3035 3036 $username = $args[1]; 3037 $password = $args[2]; 3038 $category = $args[3]; 3039 $max_results = (int) $args[4]; 2914 3040 2915 3041 if ( !$user = $this->login($username, $password) ) … … 2939 3065 * @since 2.7.0 2940 3066 * 2941 * @param array $args Method parameters. 3067 * @param array $args { 3068 * Method parameters, in this order: 3069 * 3070 * @type int $blog_id (unused) 3071 * @type string $username 3072 * @type string $password 3073 * @type int $comment_id 3074 * } 2942 3075 * @return array|IXR_Error 2943 3076 */ … … 2980 3113 * @since 2.7.0 2981 3114 * 2982 * @param array $args Method parameters. 3115 * @param array $args { 3116 * Method parameters, in this order: 3117 * 3118 * @type int $blog_id (unused) 3119 * @type string $username 3120 * @type string $password 3121 * @type array $struct 3122 * } 2983 3123 * @return array|IXR_Error Contains a collection of comments. See {@link wp_xmlrpc_server::wp_getComment()} for a description of each item contents 2984 3124 */ 2985 public function wp_getComments( $args) {2986 $this->escape( $args);2987 2988 $username 2989 $password 2990 $struct 3125 public function wp_getComments( $args ) { 3126 $this->escape( $args ); 3127 3128 $username = $args[1]; 3129 $password = $args[2]; 3130 $struct = isset( $args[3] ) ? $args[3] : array(); 2991 3131 2992 3132 if ( !$user = $this->login($username, $password) ) … … 3036 3176 * @since 2.7.0 3037 3177 * 3038 * @param array $args Method parameters. Contains: 3039 * - blog_id (unused) 3040 * - username 3041 * - password 3042 * - comment_id 3178 * @param array $args { 3179 * Method parameters, in this order: 3180 * 3181 * @type int $blog_id (unused) 3182 * @type string $username 3183 * @type string $password 3184 * @type int $comment_ID 3185 * } 3043 3186 * @return bool|IXR_Error {@link wp_delete_comment()} 3044 3187 */ … … 3098 3241 * @since 2.7.0 3099 3242 * 3243 * @param array $args { 3244 * Method parameters, in this order: 3245 * 3246 * @type int $blog_id (unused) 3247 * @type string $username 3248 * @type string $password 3249 * @type int $comment_ID 3250 * @type array $content_struct 3251 * } 3100 3252 * @param array $args Contains: 3101 3253 * - blog_id (unused) … … 3104 3256 * - comment_id 3105 3257 * - content_struct 3106 * @return bool|IXR_Error True, on success.3107 */ 3108 public function wp_editComment( $args) {3109 $this->escape( $args);3258 * @return true|IXR_Error True, on success. 3259 */ 3260 public function wp_editComment( $args ) { 3261 $this->escape( $args ); 3110 3262 3111 3263 $username = $args[1]; … … 3186 3338 * @since 2.7.0 3187 3339 * 3188 * @param array $args Method parameters. 3340 * @param array $args { 3341 * Method parameters, in this order: 3342 * 3343 * @type int $blog_id (unused) 3344 * @type string $username 3345 * @type string $password 3346 * @type string|int $post 3347 * @type array $content_struct 3348 * } 3189 3349 * @return int|IXR_Error {@link wp_new_comment()} 3190 3350 */ … … 3192 3352 $this->escape($args); 3193 3353 3194 $username 3195 $password 3196 $post 3354 $username = $args[1]; 3355 $password = $args[2]; 3356 $post = $args[3]; 3197 3357 $content_struct = $args[4]; 3198 3358 … … 3289 3449 * @since 2.7.0 3290 3450 * 3291 * @param array $args Method parameters. 3451 * @param array $args { 3452 * Method parameters, in this order: 3453 * 3454 * @type int $blog_id (unused) 3455 * @type string $username 3456 * @type string $password 3457 * } 3292 3458 * @return array|IXR_Error 3293 3459 */ … … 3295 3461 $this->escape( $args ); 3296 3462 3297 $username 3298 $password 3463 $username = $args[1]; 3464 $password = $args[2]; 3299 3465 3300 3466 if ( !$user = $this->login($username, $password) ) … … 3315 3481 * @since 2.5.0 3316 3482 * 3317 * @param array $args Method parameters. 3483 * @param array $args { 3484 * Method parameters, in this order: 3485 * 3486 * @type int $blog_id (unused) 3487 * @type string $username 3488 * @type string $password 3489 * @type int $post_id 3490 * } 3318 3491 * @return array|IXR_Error 3319 3492 */ 3320 3493 public function wp_getCommentCount( $args ) { 3321 $this->escape( $args);3494 $this->escape( $args ); 3322 3495 3323 3496 $username = $args[1]; … … 3348 3521 * @since 2.5.0 3349 3522 * 3350 * @param array $args Method parameters. 3523 * @param array $args { 3524 * Method parameters, in this order: 3525 * 3526 * @type int $blog_id (unused) 3527 * @type string $username 3528 * @type string $password 3529 * } 3351 3530 * @return array|IXR_Error 3352 3531 */ … … 3354 3533 $this->escape( $args ); 3355 3534 3356 $username 3357 $password 3535 $username = $args[1]; 3536 $password = $args[2]; 3358 3537 3359 3538 if ( !$user = $this->login($username, $password) ) … … 3374 3553 * @since 2.5.0 3375 3554 * 3376 * @param array $args Method parameters. 3555 * @param array $args { 3556 * Method parameters, in this order: 3557 * 3558 * @type int $blog_id (unused) 3559 * @type string $username 3560 * @type string $password 3561 * } 3377 3562 * @return array|IXR_Error 3378 3563 */ … … 3380 3565 $this->escape( $args ); 3381 3566 3382 $username 3383 $password 3567 $username = $args[1]; 3568 $password = $args[2]; 3384 3569 3385 3570 if ( !$user = $this->login($username, $password) ) … … 3400 3585 * @since 2.6.0 3401 3586 * 3402 * @param array $args Method parameters. 3587 * @param array $args { 3588 * Method parameters, in this order: 3589 * 3590 * @type int $blog_id (unused) 3591 * @type string $username 3592 * @type string $password 3593 * } 3403 3594 * @return array|IXR_Error 3404 3595 */ … … 3406 3597 $this->escape( $args ); 3407 3598 3408 $username 3409 $password 3599 $username = $args[1]; 3600 $password = $args[2]; 3410 3601 3411 3602 if ( !$user = $this->login($username, $password) ) … … 3426 3617 * @since 2.6.0 3427 3618 * 3428 * @param array $args Method parameters. 3619 * @param array $args { 3620 * Method parameters, in this order: 3621 * 3622 * @type int $blog_id (unused) 3623 * @type string $username 3624 * @type string $password 3625 * @type array $options 3626 * } 3429 3627 * @return array|IXR_Error 3430 3628 */ … … 3479 3677 * @since 2.6.0 3480 3678 * 3481 * @param array $args Method parameters. 3679 * @param array $args { 3680 * Method parameters, in this order: 3681 * 3682 * @type int $blog_id (unused) 3683 * @type string $username 3684 * @type string $password 3685 * @type array $options 3686 * } 3482 3687 * @return array|IXR_Error 3483 3688 */ … … 3516 3721 * @since 3.1.0 3517 3722 * 3518 * @param array $args Method parameters. Contains: 3519 * - blog_id (unused) 3520 * - username 3521 * - password 3522 * - attachment_id 3723 * @param array $args { 3724 * Method parameters, in this order: 3725 * 3726 * @type int $blog_id (unused) 3727 * @type string $username 3728 * @type string $password 3729 * @type int $attachment_id 3730 * } 3523 3731 * @return array|IXR_Error Associative array contains: 3524 3732 * - 'date_created_gmt' … … 3531 3739 * - 'metadata' 3532 3740 */ 3533 public function wp_getMediaItem( $args) {3534 $this->escape( $args);3741 public function wp_getMediaItem( $args ) { 3742 $this->escape( $args ); 3535 3743 3536 3744 $username = $args[1]; … … 3569 3777 * @since 3.1.0 3570 3778 * 3571 * @param array $args Method parameters. Contains: 3572 * - blog_id (unused) 3573 * - username 3574 * - password 3575 * - filter 3779 * @param array $args { 3780 * Method parameters, in this order: 3781 * 3782 * @type int $blog_id (unused) 3783 * @type string $username 3784 * @type string $password 3785 * @type array $struct 3786 * } 3576 3787 * @return array|IXR_Error Contains a collection of media items. See {@link wp_xmlrpc_server::wp_getMediaItem()} for a description of each item contents 3577 3788 */ … … 3612 3823 * @since 3.1.0 3613 3824 * 3614 * @param array $args Method parameters. Contains: 3615 * - blog_id (unused) 3616 * - username 3617 * - password 3825 * @param array $args { 3826 * Method parameters, in this order: 3827 * 3828 * @type int $blog_id (unused) 3829 * @type string $username 3830 * @type string $password 3831 * } 3618 3832 * @return array|IXR_Error 3619 3833 */ … … 3659 3873 * 3660 3874 * @uses get_post_type_object() 3661 * @param array $args Method parameters. Contains: 3662 * - int $blog_id (unused) 3663 * - string $username 3664 * - string $password 3665 * - string $post_type_name 3666 * - array $fields 3875 * @param array $args { 3876 * Method parameters, in this order: 3877 * 3878 * @type int $blog_id (unused) 3879 * @type string $username 3880 * @type string $password 3881 * @type string $post_type_name 3882 * @type array $fields (optional) 3883 * } 3667 3884 * @return array|IXR_Error Array contains: 3668 3885 * - 'labels' … … 3723 3940 * 3724 3941 * @uses get_post_types() 3725 * @param array $args Method parameters. Contains: 3726 * - int $blog_id (unused) 3727 * - string $username 3728 * - string $password 3729 * - array $filter 3730 * - array $fields 3942 * @param array $args { 3943 * Method parameters, in this order: 3944 * 3945 * @type int $blog_id (unused) 3946 * @type string $username 3947 * @type string $password 3948 * @type array $filter (optional) 3949 * @type array $fields (optional) 3950 * } 3731 3951 * @return array|IXR_Error 3732 3952 */ … … 3737 3957 $this->escape( $args ); 3738 3958 3739 $username 3740 $password 3741 $filter 3959 $username = $args[1]; 3960 $password = $args[2]; 3961 $filter = isset( $args[3] ) ? $args[3] : array( 'public' => true ); 3742 3962 3743 3963 if ( isset( $args[4] ) ) { … … 3779 3999 * @see wp_getPost() for more on $fields 3780 4000 * 3781 * @param array $args Method parameters. Contains: 3782 * - int $blog_id (unused) 3783 * - string $username 3784 * - string $password 3785 * - int $post_id 3786 * - array $fields 4001 * @param array $args { 4002 * Method parameters, in this order: 4003 * 4004 * @type int $blog_id (unused) 4005 * @type string $username 4006 * @type string $password 4007 * @type int $post_id 4008 * @type array $fields (optional) 4009 * } 3787 4010 * @return array|IXR_Error contains a collection of posts. 3788 4011 */ … … 3793 4016 $this->escape( $args ); 3794 4017 3795 $username 3796 $password 3797 $post_id 4018 $username = $args[1]; 4019 $password = $args[2]; 4020 $post_id = (int) $args[3]; 3798 4021 3799 4022 if ( isset( $args[4] ) ) { … … 3855 4078 * @uses wp_restore_post_revision() 3856 4079 * 3857 * @param array $args Method parameters. Contains: 3858 * - int $blog_id (unused) 3859 * - string $username 3860 * - string $password 3861 * - int $post_id 4080 * @param array $args { 4081 * Method parameters, in this order: 4082 * 4083 * @type int $blog_id (unused) 4084 * @type string $username 4085 * @type string $password 4086 * @type int $revision_id 4087 * } 3862 4088 * @return bool|IXR_Error false if there was an error restoring, true if success. 3863 4089 */ … … 3910 4136 * @since 1.5.0 3911 4137 * 3912 * @param array $args Method parameters. 4138 * @param array $args { 4139 * Method parameters, in this order: 4140 * 4141 * @type int $blog_id (unused) 4142 * @type string $username 4143 * @type string $password 4144 * } 3913 4145 * @return array|IXR_Error 3914 4146 */ … … 3920 4152 3921 4153 $username = $args[1]; 3922 $password 4154 $password = $args[2]; 3923 4155 3924 4156 if ( !$user = $this->login($username, $password) ) … … 3979 4211 * @since 1.5.0 3980 4212 * 3981 * @param array $args Method parameters. 4213 * @param array $args { 4214 * Method parameters, in this order: 4215 * 4216 * @type int $blog_id (unused) 4217 * @type string $username 4218 * @type string $password 4219 * } 3982 4220 * @return array|IXR_Error 3983 4221 */ 3984 public function blogger_getUserInfo($args) { 3985 3986 $this->escape($args); 4222 public function blogger_getUserInfo( $args ) { 4223 $this->escape( $args ); 3987 4224 3988 4225 $username = $args[1]; 3989 $password 4226 $password = $args[2]; 3990 4227 3991 4228 if ( !$user = $this->login($username, $password) ) … … 4014 4251 * @since 1.5.0 4015 4252 * 4016 * @param array $args Method parameters. 4253 * @param array $args { 4254 * Method parameters, in this order: 4255 * 4256 * @type int $blog_id (unused) 4257 * @type int $post_ID 4258 * @type string $username 4259 * @type string $password 4260 * } 4017 4261 * @return array|IXR_Error 4018 4262 */ 4019 public function blogger_getPost($args) { 4020 4021 $this->escape($args); 4022 4023 $post_ID = (int) $args[1]; 4263 public function blogger_getPost( $args ) { 4264 $this->escape( $args ); 4265 4266 $post_ID = (int) $args[1]; 4024 4267 $username = $args[2]; 4025 $password 4268 $password = $args[3]; 4026 4269 4027 4270 if ( !$user = $this->login($username, $password) ) … … 4059 4302 * @since 1.5.0 4060 4303 * 4061 * @param array $args Method parameters. 4304 * @param array $args { 4305 * Method parameters, in this order: 4306 * 4307 * @type string $appkey (unused) 4308 * @type int $blog_id (unused) 4309 * @type string $username 4310 * @type string $password 4311 * @type int $numberposts (optional) 4312 * } 4062 4313 * @return array|IXR_Error 4063 4314 */ 4064 public function blogger_getRecentPosts( $args) {4315 public function blogger_getRecentPosts( $args ) { 4065 4316 4066 4317 $this->escape($args); … … 4068 4319 // $args[0] = appkey - ignored 4069 4320 $username = $args[2]; 4070 $password 4321 $password = $args[3]; 4071 4322 if ( isset( $args[4] ) ) 4072 4323 $query = array( 'numberposts' => absint( $args[4] ) ); … … 4140 4391 * @since 1.5.0 4141 4392 * 4142 * @param array $args Method parameters. 4393 * @param array $args { 4394 * Method parameters, in this order: 4395 * 4396 * @type string $appkey (unused) 4397 * @type int $blog_id (unused) 4398 * @type string $username 4399 * @type string $password 4400 * @type string $content 4401 * @type string $publish 4402 * } 4143 4403 * @return int|IXR_Error 4144 4404 */ 4145 public function blogger_newPost($args) { 4146 4147 $this->escape($args); 4405 public function blogger_newPost( $args ) { 4406 $this->escape( $args ); 4148 4407 4149 4408 $username = $args[2]; 4150 $password 4151 $content 4152 $publish 4409 $password = $args[3]; 4410 $content = $args[4]; 4411 $publish = $args[5]; 4153 4412 4154 4413 if ( !$user = $this->login($username, $password) ) … … 4202 4461 * @since 1.5.0 4203 4462 * 4204 * @param array $args Method parameters. 4205 * @return bool|IXR_Error true when done. 4463 * @param array $args { 4464 * Method parameters, in this order: 4465 * 4466 * @type int $blog_id (unused) 4467 * @type int $post_ID 4468 * @type string $username 4469 * @type string $password 4470 * @type string $content 4471 * } 4472 * @return true|IXR_Error true when done. 4206 4473 */ 4207 4474 public function blogger_editPost( $args ) { … … 4209 4476 $this->escape($args); 4210 4477 4211 $post_ID 4212 $username 4213 $password 4214 $content 4478 $post_ID = (int) $args[1]; 4479 $username = $args[2]; 4480 $password = $args[3]; 4481 $content = $args[4]; 4215 4482 4216 4483 if ( ! $user = $this->login( $username, $password ) ) { … … 4269 4536 * @since 1.5.0 4270 4537 * 4271 * @param array $args Method parameters. 4272 * @return bool|IXR_Error True when post is deleted. 4273 */ 4274 public function blogger_deletePost($args) { 4275 $this->escape($args); 4276 4277 $post_ID = (int) $args[1]; 4278 $username = $args[2]; 4279 $password = $args[3]; 4538 * @param array $args { 4539 * Method parameters, in this order: 4540 * 4541 * @type int $blog_id (unused) 4542 * @type int $post_ID 4543 * @type string $username 4544 * @type string $password 4545 * } 4546 * @return true|IXR_Error True when post is deleted. 4547 */ 4548 public function blogger_deletePost( $args ) { 4549 $this->escape( $args ); 4550 4551 $post_ID = (int) $args[1]; 4552 $username = $args[2]; 4553 $password = $args[3]; 4280 4554 4281 4555 if ( !$user = $this->login($username, $password) ) … … 4342 4616 * @since 1.5.0 4343 4617 * 4344 * @param array $args Method parameters. Contains: 4345 * - blog_id (unused) 4346 * - username 4347 * - password 4348 * - content_struct 4349 * - publish 4618 * @param array $args { 4619 * Method parameters, in this order: 4620 * 4621 * @type int $blog_id (unused) 4622 * @type string $username 4623 * @type string $password 4624 * @type array $content_struct 4625 * @type int $publish 4626 * } 4350 4627 * @return int|IXR_Error 4351 4628 */ … … 4353 4630 $this->escape($args); 4354 4631 4355 $username = $args[1];4356 $password = $args[2];4632 $username = $args[1]; 4633 $password = $args[2]; 4357 4634 $content_struct = $args[3]; 4358 $publish = isset( $args[4] ) ? $args[4] : 0;4635 $publish = isset( $args[4] ) ? $args[4] : 0; 4359 4636 4360 4637 if ( !$user = $this->login($username, $password) ) … … 4655 4932 * @since 2.1.0 4656 4933 * 4934 * @global wpdb $wpdb 4935 * 4657 4936 * @param int $post_ID Post ID. 4658 4937 * @param string $post_content Post Content for attachment. … … 4676 4955 * @since 1.5.0 4677 4956 * 4678 * @param array $args Method parameters. 4957 * @param array $args { 4958 * Method parameters, in this order: 4959 * 4960 * @type int $blog_id (unused) 4961 * @type string $username 4962 * @type string $password 4963 * @type array $content_struct 4964 * @type int $publish 4965 * } 4679 4966 * @return bool|IXR_Error True on success. 4680 4967 */ 4681 public function mw_editPost($args) { 4682 4683 $this->escape($args); 4968 public function mw_editPost( $args ) { 4969 $this->escape( $args ); 4684 4970 4685 4971 $post_ID = (int) $args[0]; … … 4968 5254 * @since 1.5.0 4969 5255 * 4970 * @param array $args Method parameters. 5256 * @param array $args { 5257 * Method parameters, in this order: 5258 * 5259 * @type int $blog_id (unused) 5260 * @type int $post_ID 5261 * @type string $username 5262 * @type string $password 5263 * } 4971 5264 * @return array|IXR_Error 4972 5265 */ 4973 public function mw_getPost($args) { 4974 4975 $this->escape($args); 4976 4977 $post_ID = (int) $args[0]; 4978 $username = $args[1]; 4979 $password = $args[2]; 5266 public function mw_getPost( $args ) { 5267 $this->escape( $args ); 5268 5269 $post_ID = (int) $args[0]; 5270 $username = $args[1]; 5271 $password = $args[2]; 4980 5272 4981 5273 if ( !$user = $this->login($username, $password) ) … … 5093 5385 * @since 1.5.0 5094 5386 * 5095 * @param array $args Method parameters. 5387 * @param array $args { 5388 * Method parameters, in this order: 5389 * 5390 * @type int $blog_id (unused) 5391 * @type string $username 5392 * @type string $password 5393 * @type int $numberposts 5394 * } 5096 5395 * @return array|IXR_Error 5097 5396 */ 5098 public function mw_getRecentPosts($args) { 5099 5100 $this->escape($args); 5101 5102 $username = $args[1]; 5103 $password = $args[2]; 5397 public function mw_getRecentPosts( $args ) { 5398 $this->escape( $args ); 5399 5400 $username = $args[1]; 5401 $password = $args[2]; 5104 5402 if ( isset( $args[3] ) ) 5105 5403 $query = array( 'numberposts' => absint( $args[3] ) ); … … 5205 5503 * @since 1.5.0 5206 5504 * 5207 * @param array $args Method parameters. 5505 * @param array $args { 5506 * Method parameters, in this order: 5507 * 5508 * @type int $blog_id (unused) 5509 * @type string $username 5510 * @type string $password 5511 * } 5208 5512 * @return array|IXR_Error 5209 5513 */ 5210 public function mw_getCategories($args) { 5211 5212 $this->escape($args); 5213 5214 $username = $args[1]; 5215 $password = $args[2]; 5514 public function mw_getCategories( $args ) { 5515 $this->escape( $args ); 5516 5517 $username = $args[1]; 5518 $password = $args[2]; 5216 5519 5217 5520 if ( !$user = $this->login($username, $password) ) … … 5253 5556 * @since 1.5.0 5254 5557 * 5255 * @param array $args Method parameters. 5558 * @global wpdb $wpdb 5559 * 5560 * @param array $args { 5561 * Method parameters, in this order: 5562 * 5563 * @type int $blog_id (unused) 5564 * @type string $username 5565 * @type string $password 5566 * @type array $data 5567 * } 5256 5568 * @return array|IXR_Error 5257 5569 */ 5258 public function mw_newMediaObject( $args) {5570 public function mw_newMediaObject( $args ) { 5259 5571 global $wpdb; 5260 5572 5261 $username = $this->escape($args[1]);5262 $password = $this->escape($args[2]);5263 $data 5573 $username = $this->escape( $args[1] ); 5574 $password = $this->escape( $args[2] ); 5575 $data = $args[3]; 5264 5576 5265 5577 $name = sanitize_file_name( $data['name'] ); … … 5366 5678 * @since 1.5.0 5367 5679 * 5368 * @param array $args Method parameters. 5680 * @param array $args { 5681 * Method parameters, in this order: 5682 * 5683 * @type int $blog_id (unused) 5684 * @type string $username 5685 * @type string $password 5686 * @type int $numberposts 5687 * } 5369 5688 * @return array|IXR_Error 5370 5689 */ 5371 public function mt_getRecentPostTitles($args) { 5372 5373 $this->escape($args); 5374 5375 $username = $args[1]; 5376 $password = $args[2]; 5690 public function mt_getRecentPostTitles( $args ) { 5691 $this->escape( $args ); 5692 5693 $username = $args[1]; 5694 $password = $args[2]; 5377 5695 if ( isset( $args[3] ) ) 5378 5696 $query = array( 'numberposts' => absint( $args[3] ) ); … … 5420 5738 * @since 1.5.0 5421 5739 * 5422 * @param array $args Method parameters. 5740 * @param array $args { 5741 * Method parameters, in this order: 5742 * 5743 * @type int $blog_id (unused) 5744 * @type string $username 5745 * @type string $password 5746 * } 5423 5747 * @return array|IXR_Error 5424 5748 */ 5425 public function mt_getCategoryList($args) { 5426 5427 $this->escape($args); 5428 5429 $username = $args[1]; 5430 $password = $args[2]; 5749 public function mt_getCategoryList( $args ) { 5750 $this->escape( $args ); 5751 5752 $username = $args[1]; 5753 $password = $args[2]; 5431 5754 5432 5755 if ( !$user = $this->login($username, $password) ) … … 5459 5782 * @since 1.5.0 5460 5783 * 5461 * @param array $args Method parameters. 5784 * @param array $args { 5785 * Method parameters, in this order: 5786 * 5787 * @type int $post_ID 5788 * @type string $username 5789 * @type string $password 5790 * } 5462 5791 * @return array|IXR_Error 5463 5792 */ 5464 public function mt_getPostCategories($args) { 5465 5466 $this->escape($args); 5467 5468 $post_ID = (int) $args[0]; 5469 $username = $args[1]; 5470 $password = $args[2]; 5793 public function mt_getPostCategories( $args ) { 5794 $this->escape( $args ); 5795 5796 $post_ID = (int) $args[0]; 5797 $username = $args[1]; 5798 $password = $args[2]; 5471 5799 5472 5800 if ( !$user = $this->login($username, $password) ) … … 5503 5831 * @since 1.5.0 5504 5832 * 5505 * @param array $args Method parameters. 5506 * @return bool|IXR_Error True on success. 5507 */ 5508 public function mt_setPostCategories($args) { 5509 5510 $this->escape($args); 5511 5512 $post_ID = (int) $args[0]; 5513 $username = $args[1]; 5833 * @param array $args { 5834 * Method parameters, in this order: 5835 * 5836 * @type int $post_ID 5837 * @type string $username 5838 * @type string $password 5839 * @type array $categories 5840 * } 5841 * @return true|IXR_Error True on success. 5842 */ 5843 public function mt_setPostCategories( $args ) { 5844 $this->escape( $args ); 5845 5846 $post_ID = (int) $args[0]; 5847 $username = $args[1]; 5514 5848 $password = $args[2]; 5515 $categories 5849 $categories = $args[3]; 5516 5850 5517 5851 if ( !$user = $this->login($username, $password) ) … … 5542 5876 * @since 1.5.0 5543 5877 * 5544 * @param array $args Method parameters.5545 5878 * @return array 5546 5879 */ 5547 public function mt_supportedMethods($args) { 5548 5880 public function mt_supportedMethods() { 5549 5881 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5550 5882 do_action( 'xmlrpc_call', 'mt.supportedMethods' ); 5551 5883 5552 $supported_methods = array(); 5553 foreach ( $this->methods as $key => $value ) { 5554 $supported_methods[] = $key; 5555 } 5556 5557 return $supported_methods; 5884 return array_keys( $this->methods ); 5558 5885 } 5559 5886 … … 5562 5889 * 5563 5890 * @since 1.5.0 5564 * 5565 * @param array $args Method parameters. 5566 */ 5567 public function mt_supportedTextFilters($args) { 5891 */ 5892 public function mt_supportedTextFilters() { 5568 5893 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5569 5894 do_action( 'xmlrpc_call', 'mt.supportedTextFilters' ); … … 5584 5909 * @since 1.5.0 5585 5910 * 5586 * @param array $args Method parameters. 5911 * @global wpdb $wpdb 5912 * 5913 * @param int $post_ID 5587 5914 * @return array|IXR_Error 5588 5915 */ 5589 public function mt_getTrackbackPings($args) { 5590 5916 public function mt_getTrackbackPings( $post_ID ) { 5591 5917 global $wpdb; 5592 5593 $post_ID = intval($args);5594 5918 5595 5919 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ … … 5627 5951 * @since 1.5.0 5628 5952 * 5629 * @param array $args Method parameters. 5953 * @param array $args { 5954 * Method parameters, in this order: 5955 * 5956 * @type int $post_ID 5957 * @type string $username 5958 * @type string $password 5959 * } 5630 5960 * @return int|IXR_Error 5631 5961 */ 5632 public function mt_publishPost($args) { 5633 5634 $this->escape($args); 5635 5636 $post_ID = (int) $args[0]; 5637 $username = $args[1]; 5638 $password = $args[2]; 5962 public function mt_publishPost( $args ) { 5963 $this->escape( $args ); 5964 5965 $post_ID = (int) $args[0]; 5966 $username = $args[1]; 5967 $password = $args[2]; 5639 5968 5640 5969 if ( !$user = $this->login($username, $password) ) … … 5658 5987 $this->escape($postdata); 5659 5988 5660 $result = wp_update_post($postdata); 5661 5662 return $result; 5989 return wp_update_post( $postdata ); 5663 5990 } 5664 5991 … … 5672 5999 * @since 1.5.0 5673 6000 * 5674 * @param array $args Method parameters. 6001 * @global wpdb $wpdb 6002 * @global string $wp_version 6003 * 6004 * @param array $args { 6005 * Method parameters, in this order: 6006 * 6007 * @type string $pagelinkedfrom 6008 * @type string $pagelinkedto 6009 * } 5675 6010 * @return string|IXR_Error 5676 6011 */ 5677 public function pingback_ping( $args) {5678 global $wpdb ;6012 public function pingback_ping( $args ) { 6013 global $wpdb, $wp_version; 5679 6014 5680 6015 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5681 6016 do_action( 'xmlrpc_call', 'pingback.ping' ); 5682 6017 5683 $this->escape($args); 5684 5685 $pagelinkedfrom = $args[0]; 5686 $pagelinkedto = $args[1]; 5687 5688 $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom); 5689 $pagelinkedto = str_replace('&', '&', $pagelinkedto); 5690 $pagelinkedto = str_replace('&', '&', $pagelinkedto); 6018 $this->escape( $args ); 6019 6020 $pagelinkedfrom = str_replace( '&', '&', $args[0] ); 6021 $pagelinkedto = str_replace( '&', '&', $args[1] ); 6022 $pagelinkedto = str_replace( '&', '&', $pagelinkedto ); 5691 6023 5692 6024 /** … … 5767 6099 5768 6100 /** This filter is documented in wp-includes/class-http.php */ 5769 $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $ GLOBALS['wp_version']. '; ' . get_bloginfo( 'url' ) );6101 $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); 5770 6102 5771 6103 // Let's check the remote site … … 5878 6210 * @since 1.5.0 5879 6211 * 5880 * @param array $args Method parameters. 6212 * @global wpdb $wpdb 6213 * 6214 * @param string $url 5881 6215 * @return array|IXR_Error 5882 6216 */ 5883 public function pingback_extensions_getPingbacks($args) { 5884 6217 public function pingback_extensions_getPingbacks( $url ) { 5885 6218 global $wpdb; 5886 6219 … … 5888 6221 do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks' ); 5889 6222 5890 $this->escape($args); 5891 5892 $url = $args; 6223 $url = $this->escape( $url ); 5893 6224 5894 6225 $post_ID = url_to_postid($url); … … 5922 6253 * @param integer $code 5923 6254 * @param string $message 6255 * @return IXR_Error 5924 6256 */ 5925 6257 protected function pingback_error( $code, $message ) {
Note: See TracChangeset
for help on using the changeset viewer.