Make WordPress Core

Ticket #32444: 32444.3.diff

File 32444.3.diff, 51.8 KB (added by wonderboymusic, 10 years ago)
  • src/wp-includes/class-wp-theme.php

     
    403403                static $keys = array(
    404404                        'Name', 'Version', 'Status', 'Title', 'Author', 'Author Name', 'Author URI', 'Description',
    405405                        'Template', 'Stylesheet', 'Template Files', 'Stylesheet Files', 'Template Dir', 'Stylesheet Dir',
    406                          'Screenshot', 'Tags', 'Theme Root', 'Theme Root URI', 'Parent Theme',
     406                        'Screenshot', 'Tags', 'Theme Root', 'Theme Root URI', 'Parent Theme',
    407407                );
    408408
    409409                return in_array( $offset, $keys );
  • src/wp-includes/class-wp-xmlrpc-server.php

     
    158158         *
    159159         * @param callable $name      Method to call.
    160160         * @param array    $arguments Arguments to pass when calling.
    161          * @return mixed|bool Return value of the callback, false otherwise.
     161         * @return array|IXR_Error|false Return value of the callback, false otherwise.
    162162         */
    163163        public function __call( $name, $arguments ) {
    164164                if ( '_multisite_getUsersBlogs' === $name ) {
     
    176176         *
    177177         * @since 1.5.0
    178178         *
    179          * @param array $args Method Parameters.
    180179         * @return string
    181180         */
    182         public function sayHello($args) {
     181        public function sayHello() {
    183182                return 'Hello!';
    184183        }
    185184
     
    188187         *
    189188         * @since 1.5.0
    190189         *
    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         * }
    192196         * @return int
    193197         */
    194         public function addTwoNumbers($args) {
     198        public function addTwoNumbers( $args ) {
    195199                $number1 = $args[0];
    196200                $number2 = $args[1];
    197201                return $number1 + $number2;
     
    275279         * @since 1.5.2
    276280         *
    277281         * @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.
    279284         */
    280285        public function escape( &$data ) {
    281286                if ( ! is_array( $data ) )
     
    354359         * Passes property through 'xmlrpc_blog_options' filter.
    355360         *
    356361         * @since 2.6.0
     362         *
     363         * @global string $wp_version
    357364         */
    358365        public function initialise_blog_option_info() {
    359366                global $wp_version;
     
    514521         *
    515522         * @since 2.6.0
    516523         *
    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         * }
    520530         * @return array|IXR_Error Array contains:
    521531         *  - 'isAdmin'
    522532         *  - 'url'
     
    587597         *
    588598         * @param string|array $args Sanitize single string or array of strings.
    589599         * @param int $count Minimum number of arguments.
    590          * @return boolean if $args contains at least $count arguments.
     600         * @return bool if $args contains at least $count arguments.
    591601         */
    592602        protected function minimum_args( $args, $count ) {
    593603                if ( count( $args ) < $count ) {
     
    651661         */
    652662        protected function _prepare_term( $term ) {
    653663                $_term = $term;
    654                 if ( ! is_array( $_term) )
     664                if ( ! is_array( $_term ) )
    655665                        $_term = get_object_vars( $_term );
    656666
    657667                // For integers which may be larger than XML-RPC supports ensure we return strings.
     
    10771087         *
    10781088         * @since 3.4.0
    10791089         *
    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:
    10861097         *      - post_type (default: 'post')
    10871098         *      - post_status (default: 'draft')
    10881099         *      - post_title
     
    11011112         *      - terms_names - array, with taxonomy names as keys and arrays of term names as values
    11021113         *      - enclosure
    11031114         *      - any other fields supported by wp_insert_post()
     1115         * }
     1116         *
    11041117         * @return string|IXR_Error post_id
    11051118         */
    11061119        public function wp_newPost( $args ) {
     
    11581171         *
    11591172         * @param WP_User $user The post author if post_author isn't set in $content_struct.
    11601173         * @param array|IXR_Error $content_struct Post data to insert.
     1174         * @return IXR_Error|string
    11611175         */
    11621176        protected function _insert_post( $user, $content_struct ) {
    11631177                $defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
     
    14031417         *
    14041418         * @since 3.4.0
    14051419         *
    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
     1420         * @param array  $args {
     1421         *     Method parameters, in this order:
     1422         *
     1423         *     @type int    $blog_id (unused)
     1424         *     @type string $username
     1425         *     @type string $password
     1426         *     @type int    $post_id
     1427         *     @type array  $content_struct
     1428         * }
     1429         *
     1430         * @return true|IXR_Error true on success
    14131431         */
    14141432        public function wp_editPost( $args ) {
    14151433                if ( ! $this->minimum_args( $args, 5 ) )
     
    14661484         * @since 3.4.0
    14671485         *
    14681486         * @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
     1487         *
     1488         * @param array  $args {
     1489         *     Method parameters, in this order:
     1490         *
     1491         *     @type int    $blog_id (unused)
     1492         *     @type string $username
     1493         *     @type string $password
     1494         *     @type int    $post_id
     1495         * }
     1496         * @return true|IXR_Error true on success
    14751497         */
    14761498        public function wp_deletePost( $args ) {
    14771499                if ( ! $this->minimum_args( $args, 4 ) )
     
    15551577
    15561578                $this->escape( $args );
    15571579
    1558                 $username           = $args[1];
    1559                 $password           = $args[2];
    1560                 $post_id            = (int) $args[3];
     1580                $username = $args[1];
     1581                $password = $args[2];
     1582                $post_id  = (int) $args[3];
    15611583
    15621584                if ( isset( $args[4] ) ) {
    15631585                        $fields = $args[4];
     
    16201642
    16211643                $this->escape( $args );
    16221644
    1623                 $username   = $args[1];
    1624                 $password   = $args[2];
    1625                 $filter     = isset( $args[3] ) ? $args[3] : array();
     1645                $username = $args[1];
     1646                $password = $args[2];
     1647                $filter   = isset( $args[3] ) ? $args[3] : array();
    16261648
    16271649                if ( isset( $args[4] ) ) {
    16281650                        $fields = $args[4];
     
    17161738
    17171739                $this->escape( $args );
    17181740
    1719                 $username           = $args[1];
    1720                 $password           = $args[2];
    1721                 $content_struct     = $args[3];
     1741                $username       = $args[1];
     1742                $password       = $args[2];
     1743                $content_struct = $args[3];
    17221744
    17231745                if ( ! $user = $this->login( $username, $password ) )
    17241746                        return $this->error;
     
    17951817         *      - 'parent'
    17961818         *      - 'description'
    17971819         *      - 'slug'
    1798          * @return bool|IXR_Error True, on success.
     1820         * @return true|IXR_Error True, on success.
    17991821         */
    18001822        public function wp_editTerm( $args ) {
    18011823                if ( ! $this->minimum_args( $args, 5 ) )
     
    18031825
    18041826                $this->escape( $args );
    18051827
    1806                 $username           = $args[1];
    1807                 $password           = $args[2];
    1808                 $term_id            = (int) $args[3];
    1809                 $content_struct     = $args[4];
     1828                $username       = $args[1];
     1829                $password       = $args[2];
     1830                $term_id        = (int) $args[3];
     1831                $content_struct = $args[4];
    18101832
    18111833                if ( ! $user = $this->login( $username, $password ) )
    18121834                        return $this->error;
     
    18811903         * @since 3.4.0
    18821904         *
    18831905         * @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
     1906         *
     1907         * @param array  $args {
     1908         *     Method parameters, in this order:
     1909         *
     1910         *     @type int    $blog_id (unused)
     1911         *     @type string $username
     1912         *     @type string $password
     1913         *     @type string $taxnomy_name
     1914         *     @type string $term_id
     1915         * }
     1916         * @return bool|IXR_Error If it suceeded true else a reason why not
    18911917         */
    18921918        public function wp_deleteTerm( $args ) {
    18931919                if ( ! $this->minimum_args( $args, 5 ) )
     
    19391965         * @since 3.4.0
    19401966         *
    19411967         * @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
     1968         *
     1969         * @param array  $args {
     1970         *     Method parameters, in this order:
     1971         *
     1972         *     @type int    $blog_id (unused)
     1973         *     @type string $username
     1974         *     @type string $password
     1975         *     @type string $taxnomy
     1976         *     @type string $term_id
     1977         * }
    19481978         * @return array|IXR_Error Array contains:
    19491979         *  - 'term_id'
    19501980         *  - 'name'
     
    20012031         * Accepted keys are 'number', 'offset', 'orderby', 'order', 'hide_empty', and 'search'.
    20022032         *
    20032033         * @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
     2034         *
     2035         * @param array  $args {
     2036         *     Method parameters, in this order:
     2037         *
     2038         *     @type int    $blog_id (unused)
     2039         *     @type string $username
     2040         *     @type string $password
     2041         *     @type string $taxnomy
     2042         *     @type array  $filter (optional)
     2043         * }
    20102044         * @return array|IXR_Error terms
    20112045         */
    20122046        public function wp_getTerms( $args ) {
     
    20772111         * @since 3.4.0
    20782112         *
    20792113         * @uses get_taxonomy()
    2080          * @param array $args Method parameters. Contains:
    2081          *  - int     $blog_id (unused)
    2082          *  - string  $username
    2083          *  - string  $password
    2084          *  - string  $taxonomy
     2114         *
     2115         * @param array  $args {
     2116         *     Method parameters, in this order:
     2117         *
     2118         *     @type int    $blog_id (unused)
     2119         *     @type string $username
     2120         *     @type string $password
     2121         *     @type string $taxnomy
     2122         *     @type array  $fields (optional)
     2123         * }
    20852124         * @return array|IXR_Error (@see get_taxonomy())
    20862125         */
    20872126        public function wp_getTaxonomy( $args ) {
     
    20902129
    20912130                $this->escape( $args );
    20922131
    2093                 $username       = $args[1];
    2094                 $password       = $args[2];
    2095                 $taxonomy       = $args[3];
     2132                $username = $args[1];
     2133                $password = $args[2];
     2134                $taxonomy = $args[3];
    20962135
    20972136                if ( isset( $args[4] ) ) {
    20982137                        $fields = $args[4];
     
    21312170         * @since 3.4.0
    21322171         *
    21332172         * @uses get_taxonomies()
    2134          * @param array $args Method parameters. Contains:
    2135          *  - int     $blog_id (unused)
    2136          *  - string  $username
    2137          *  - string  $password
     2173         *
     2174         * @param array  $args {
     2175         *     Method parameters, in this order:
     2176         *
     2177         *     @type int    $blog_id (unused)
     2178         *     @type string $username
     2179         *     @type string $password
     2180         * }
    21382181         * @return array taxonomies
    21392182         */
    21402183        public function wp_getTaxonomies( $args ) {
     
    21432186
    21442187                $this->escape( $args );
    21452188
    2146                 $username           = $args[1];
    2147                 $password           = $args[2];
    2148                 $filter             = isset( $args[3] ) ? $args[3] : array( 'public' => true );
     2189                $username = $args[1];
     2190                $password = $args[2];
     2191                $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
    21492192
    21502193                if ( isset( $args[4] ) ) {
    21512194                        $fields = $args[4];
     
    21882231         * groups are 'basic' and 'all'.
    21892232         *
    21902233         * @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
     2234         *
     2235         * @param array  $args {
     2236         *     Method parameters, in this order:
     2237         *
     2238         *     @type int    $blog_id (unused)
     2239         *     @type string $username
     2240         *     @type string $password
     2241         *     @type int    $user_id
     2242         *     @type array  $fields (optional)
     2243         * }
    21972244         * @return array|IXR_Error Array contains (based on $fields parameter):
    21982245         *  - 'user_id'
    21992246         *  - 'username'
     
    22142261
    22152262                $this->escape( $args );
    22162263
    2217                 $username   = $args[1];
    2218                 $password   = $args[2];
    2219                 $user_id    = (int) $args[3];
     2264                $username = $args[1];
     2265                $password = $args[2];
     2266                $user_id  = (int) $args[3];
    22202267
    22212268                if ( isset( $args[4] ) ) {
    22222269                        $fields = $args[4];
     
    22622309         * @uses get_users()
    22632310         * @see wp_getUser() for more on $fields and return values
    22642311         *
    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
     2312         * @param array  $args {
     2313         *     Method parameters, in this order:
     2314         *
     2315         *     @type int    $blog_id (unused)
     2316         *     @type string $username
     2317         *     @type string $password
     2318         *     @type array  $filter (optional)
     2319         *     @type array  $fields (optional)
     2320         * }
    22712321         * @return array|IXR_Error users data
    22722322         */
    22732323        public function wp_getUsers( $args ) {
     
    22762326
    22772327                $this->escape( $args );
    22782328
    2279                 $username   = $args[1];
    2280                 $password   = $args[2];
    2281                 $filter     = isset( $args[3] ) ? $args[3] : array();
     2329                $username = $args[1];
     2330                $password = $args[2];
     2331                $filter   = isset( $args[3] ) ? $args[3] : array();
    22822332
    22832333                if ( isset( $args[4] ) ) {
    22842334                        $fields = $args[4];
     
    23332383         * Retrieve information about the requesting user.
    23342384         *
    23352385         * @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
     2386         *
     2387         * @param array  $args {
     2388         *     Method parameters, in this order:
     2389         *
     2390         *     @type int    $blog_id (unused)
     2391         *     @type string $username
     2392         *     @type string $password
     2393         *     @type array  $fields (optional)
     2394         * }
    23412395         * @return array|IXR_Error (@see wp_getUser)
    23422396         */
    23432397        public function wp_getProfile( $args ) {
     
    23462400
    23472401                $this->escape( $args );
    23482402
    2349                 $username   = $args[1];
    2350                 $password   = $args[2];
     2403                $username = $args[1];
     2404                $password = $args[2];
    23512405
    23522406                if ( isset( $args[3] ) ) {
    23532407                        $fields = $args[3];
     
    23742428         * Edit user's profile.
    23752429         *
    23762430         * @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:
     2431         *
     2432         * @param array  $args {
     2433         *     Method parameters, in this order:
     2434         *
     2435         *     @type int    $blog_id (unused)
     2436         *     @type string $username
     2437         *     @type string $password
     2438         *     @type array  $content_struct It can optionally contain:
    23832439         *      - 'first_name'
    23842440         *      - 'last_name'
    23852441         *      - 'website'
     
    23872443         *      - 'nickname'
    23882444         *      - 'nicename'
    23892445         *      - 'bio'
    2390          * @return bool|IXR_Error True, on success.
     2446         * }
     2447         *
     2448         * @return true|IXR_Error True, on success.
    23912449         */
    23922450        public function wp_editProfile( $args ) {
    23932451                if ( ! $this->minimum_args( $args, 4 ) )
     
    24502508         *
    24512509         * @since 2.2.0
    24522510         *
    2453          * @param array $args Method parameters. Contains:
    2454          *  - blog_id (unused)
    2455          *  - page_id
    2456          *  - username
    2457          *  - password
     2511         * @param array  $args {
     2512         *     Method parameters, in this order:
     2513         *
     2514         *     @type int    $blog_id (unused)
     2515         *     @type int    $page_id
     2516         *     @type string $username
     2517         *     @type string $password
     2518         * }
    24582519         * @return array|IXR_Error
    24592520         */
    2460         public function wp_getPage($args) {
    2461                 $this->escape($args);
     2521        public function wp_getPage( $args ) {
     2522                $this->escape( $args );
    24622523
    2463                 $page_id        = (int) $args[1];
    2464                 $username       = $args[2];
    2465                 $password       = $args[3];
     2524                $page_id  = (int) $args[1];
     2525                $username = $args[2];
     2526                $password = $args[3];
    24662527
    24672528                if ( !$user = $this->login($username, $password) ) {
    24682529                        return $this->error;
     
    24932554         *
    24942555         * @since 2.2.0
    24952556         *
    2496          * @param array $args Method parameters. Contains:
    2497          *  - blog_id (unused)
    2498          *  - username
    2499          *  - password
    2500          *  - num_pages
     2557         * @param array  $args {
     2558         *     Method parameters, in this order:
     2559         *
     2560         *     @type int    $blog_id (unused)
     2561         *     @type string $username
     2562         *     @type string $password
     2563         *     @type int    $num_pages
     2564         * }
    25012565         * @return array|IXR_Error
    25022566         */
    2503         public function wp_getPages($args) {
    2504                 $this->escape($args);
     2567        public function wp_getPages( $args ) {
     2568                $this->escape( $args );
    25052569
    2506                 $username       = $args[1];
    2507                 $password       = $args[2];
    2508                 $num_pages      = isset($args[3]) ? (int) $args[3] : 10;
     2570                $username  = $args[1];
     2571                $password  = $args[2];
     2572                $num_pages = isset($args[3]) ? (int) $args[3] : 10;
    25092573
    25102574                if ( !$user = $this->login($username, $password) )
    25112575                        return $this->error;
     
    25392603         *
    25402604         * @since 2.2.0
    25412605         *
    2542          * @param array $args Method parameters. See {@link wp_xmlrpc_server::mw_newPost()}
     2606         * @param array  $args {
     2607         *     See {@link wp_xmlrpc_server::mw_newPost()}
     2608         *     Method parameters, in this order:
     2609         *
     2610         *     @type int    $blog_id (unused)
     2611         *     @type string $username
     2612         *     @type string $password
     2613         *     @type array  $content_struct
     2614         * }
    25432615         * @return int|IXR_Error
    25442616         */
    2545         public function wp_newPage($args) {
     2617        public function wp_newPage( $args ) {
    25462618                // Items not escaped here will be escaped in newPost.
    2547                 $username       = $this->escape($args[1]);
    2548                 $password       = $this->escape($args[2]);
     2619                $username = $this->escape( $args[1] );
     2620                $password = $this->escape( $args[2] );
    25492621
    25502622                if ( !$user = $this->login($username, $password) )
    25512623                        return $this->error;
     
    25652637         *
    25662638         * @since 2.2.0
    25672639         *
    2568          * @param array $args Method parameters.
    2569          * @return bool|IXR_Error True, if success.
     2640         * @param array  $args {
     2641         *     Method parameters, in this order:
     2642         *
     2643         *     @type int    $blog_id (unused)
     2644         *     @type string $username
     2645         *     @type string $password
     2646         *     @type int    $page_id
     2647         * }
     2648         * @return true|IXR_Error True, if success.
    25702649         */
    2571         public function wp_deletePage($args) {
    2572                 $this->escape($args);
     2650        public function wp_deletePage( $args ) {
     2651                $this->escape( $args );
    25732652
    2574                 $username       = $args[1];
    2575                 $password       = $args[2];
    2576                 $page_id        = (int) $args[3];
     2653                $username = $args[1];
     2654                $password = $args[2];
     2655                $page_id  = (int) $args[3];
    25772656
    25782657                if ( !$user = $this->login($username, $password) )
    25792658                        return $this->error;
     
    26142693         *
    26152694         * @since 2.2.0
    26162695         *
    2617          * @param array $args Method parameters.
     2696         * @param array  $args {
     2697         *     Method parameters, in this order:
     2698         *
     2699         *     @type int    $blog_id (unused)
     2700         *     @type int    $page_id
     2701         *     @type string $username
     2702         *     @type string $password
     2703         *     @type string $content
     2704         *     @type string $publish
     2705         * }
    26182706         * @return array|IXR_Error
    26192707         */
    2620         public function wp_editPage($args) {
     2708        public function wp_editPage( $args ) {
    26212709                // Items not escaped here will be escaped in editPost.
    2622                 $page_id        = (int) $this->escape($args[1]);
    2623                 $username       = $this->escape($args[2]);
    2624                 $password       = $this->escape($args[3]);
    2625                 $content        = $args[4];
    2626                 $publish        = $args[5];
     2710                $page_id  = (int) $this->escape($args[1]);
     2711                $username = $this->escape($args[2]);
     2712                $password = $this->escape($args[3]);
     2713                $content  = $args[4];
     2714                $publish  = $args[5];
    26272715
    26282716                if ( !$user = $this->login($username, $password) )
    26292717                        return $this->error;
     
    26612749         *
    26622750         * @since 2.2.0
    26632751         *
    2664          * @param array $args Method parameters.
     2752         * @global wpdb $wpdb
     2753         *
     2754         * @param array  $args {
     2755         *     Method parameters, in this order:
     2756         *
     2757         *     @type int    $blog_id (unused)
     2758         *     @type string $username
     2759         *     @type string $password
     2760         * }
    26652761         * @return array|IXR_Error
    26662762         */
    2667         public function wp_getPageList($args) {
     2763        public function wp_getPageList( $args ) {
    26682764                global $wpdb;
    26692765
    2670                 $this->escape($args);
     2766                $this->escape( $args );
    26712767
    2672                 $username                               = $args[1];
    2673                 $password                               = $args[2];
     2768                $username = $args[1];
     2769                $password = $args[2];
    26742770
    26752771                if ( !$user = $this->login($username, $password) )
    26762772                        return $this->error;
     
    27132809         *
    27142810         * @since 2.2.0
    27152811         *
    2716          * @param array $args Method parameters.
     2812         * @param array  $args {
     2813         *     Method parameters, in this order:
     2814         *
     2815         *     @type int    $blog_id (unused)
     2816         *     @type string $username
     2817         *     @type string $password
     2818         * }
    27172819         * @return array|IXR_Error
    27182820         */
    2719         public function wp_getAuthors($args) {
     2821        public function wp_getAuthors( $args ) {
     2822                $this->escape( $args );
    27202823
    2721                 $this->escape($args);
     2824                $username = $args[1];
     2825                $password = $args[2];
    27222826
    2723                 $username       = $args[1];
    2724                 $password       = $args[2];
    2725 
    27262827                if ( !$user = $this->login($username, $password) )
    27272828                        return $this->error;
    27282829
     
    27492850         *
    27502851         * @since 2.7.0
    27512852         *
    2752          * @param array $args Method parameters.
     2853         * @param array  $args {
     2854         *     Method parameters, in this order:
     2855         *
     2856         *     @type int    $blog_id (unused)
     2857         *     @type string $username
     2858         *     @type string $password
     2859         * }
    27532860         * @return array|IXR_Error
    27542861         */
    27552862        public function wp_getTags( $args ) {
    27562863                $this->escape( $args );
    27572864
    2758                 $username               = $args[1];
    2759                 $password               = $args[2];
     2865                $username = $args[1];
     2866                $password = $args[2];
    27602867
    27612868                if ( !$user = $this->login($username, $password) )
    27622869                        return $this->error;
     
    27912898         *
    27922899         * @since 2.2.0
    27932900         *
    2794          * @param array $args Method parameters.
     2901         * @param array  $args {
     2902         *     Method parameters, in this order:
     2903         *
     2904         *     @type int    $blog_id (unused)
     2905         *     @type string $username
     2906         *     @type string $password
     2907         *     @type array  $category
     2908         * }
    27952909         * @return int|IXR_Error Category ID.
    27962910         */
    2797         public function wp_newCategory($args) {
    2798                 $this->escape($args);
     2911        public function wp_newCategory( $args ) {
     2912                $this->escape( $args );
    27992913
    2800                 $username                               = $args[1];
    2801                 $password                               = $args[2];
    2802                 $category                               = $args[3];
     2914                $username = $args[1];
     2915                $password = $args[2];
     2916                $category = $args[3];
    28032917
    28042918                if ( !$user = $this->login($username, $password) )
    28052919                        return $this->error;
     
    28602974         *
    28612975         * @since 2.5.0
    28622976         *
    2863          * @param array $args Method parameters.
     2977         * @param array  $args {
     2978         *     Method parameters, in this order:
     2979         *
     2980         *     @type int    $blog_id (unused)
     2981         *     @type string $username
     2982         *     @type string $password
     2983         *     @type int    $category_id
     2984         * }
    28642985         * @return bool|IXR_Error See {@link wp_delete_term()} for return info.
    28652986         */
    2866         public function wp_deleteCategory($args) {
    2867                 $this->escape($args);
     2987        public function wp_deleteCategory( $args ) {
     2988                $this->escape( $args );
    28682989
    2869                 $username               = $args[1];
    2870                 $password               = $args[2];
    2871                 $category_id    = (int) $args[3];
     2990                $username    = $args[1];
     2991                $password    = $args[2];
     2992                $category_id = (int) $args[3];
    28722993
    28732994                if ( !$user = $this->login($username, $password) )
    28742995                        return $this->error;
     
    29013022         *
    29023023         * @since 2.2.0
    29033024         *
    2904          * @param array $args Method parameters.
     3025         * @param array  $args {
     3026         *     Method parameters, in this order:
     3027         *
     3028         *     @type int    $blog_id (unused)
     3029         *     @type string $username
     3030         *     @type string $password
     3031         *     @type array  $category
     3032         *     @type int    $max_results
     3033         * }
    29053034         * @return array|IXR_Error
    29063035         */
    2907         public function wp_suggestCategories($args) {
    2908                 $this->escape($args);
     3036        public function wp_suggestCategories( $args ) {
     3037                $this->escape( $args );
    29093038
    2910                 $username                               = $args[1];
    2911                 $password                               = $args[2];
    2912                 $category                               = $args[3];
    2913                 $max_results                    = (int) $args[4];
     3039                $username    = $args[1];
     3040                $password    = $args[2];
     3041                $category    = $args[3];
     3042                $max_results = (int) $args[4];
    29143043
    29153044                if ( !$user = $this->login($username, $password) )
    29163045                        return $this->error;
     
    29383067         *
    29393068         * @since 2.7.0
    29403069         *
    2941          * @param array $args Method parameters.
     3070         * @param array  $args {
     3071         *     Method parameters, in this order:
     3072         *
     3073         *     @type int    $blog_id (unused)
     3074         *     @type string $username
     3075         *     @type string $password
     3076         *     @type int    $comment_id
     3077         * }
    29423078         * @return array|IXR_Error
    29433079         */
    29443080        public function wp_getComment($args) {
     
    29793115         *
    29803116         * @since 2.7.0
    29813117         *
    2982          * @param array $args Method parameters.
     3118         * @param array  $args {
     3119         *     Method parameters, in this order:
     3120         *
     3121         *     @type int    $blog_id (unused)
     3122         *     @type string $username
     3123         *     @type string $password
     3124         *     @type array  $struct
     3125         * }
    29833126         * @return array|IXR_Error Contains a collection of comments. See {@link wp_xmlrpc_server::wp_getComment()} for a description of each item contents
    29843127         */
    2985         public function wp_getComments($args) {
    2986                 $this->escape($args);
     3128        public function wp_getComments( $args ) {
     3129                $this->escape( $args );
    29873130
    2988                 $username       = $args[1];
    2989                 $password       = $args[2];
    2990                 $struct         = isset( $args[3] ) ? $args[3] : array();
     3131                $username = $args[1];
     3132                $password = $args[2];
     3133                $struct   = isset( $args[3] ) ? $args[3] : array();
    29913134
    29923135                if ( !$user = $this->login($username, $password) )
    29933136                        return $this->error;
     
    30353178         *
    30363179         * @since 2.7.0
    30373180         *
    3038          * @param array $args Method parameters. Contains:
    3039          *  - blog_id (unused)
    3040          *  - username
    3041          *  - password
    3042          *  - comment_id
     3181         * @param array  $args {
     3182         *     Method parameters, in this order:
     3183         *
     3184         *     @type int    $blog_id (unused)
     3185         *     @type string $username
     3186         *     @type string $password
     3187         *     @type int    $comment_ID
     3188         * }
    30433189         * @return bool|IXR_Error {@link wp_delete_comment()}
    30443190         */
    30453191        public function wp_deleteComment($args) {
     
    30973243         *
    30983244         * @since 2.7.0
    30993245         *
     3246         * @param array  $args {
     3247         *     Method parameters, in this order:
     3248         *
     3249         *     @type int    $blog_id (unused)
     3250         *     @type string $username
     3251         *     @type string $password
     3252         *     @type int    $comment_ID
     3253         *     @type array  $content_struct
     3254         * }
    31003255         * @param array $args Contains:
    31013256         *  - blog_id (unused)
    31023257         *  - username
     
    31033258         *  - password
    31043259         *  - comment_id
    31053260         *  - content_struct
    3106          * @return bool|IXR_Error True, on success.
     3261         * @return true|IXR_Error True, on success.
    31073262         */
    3108         public function wp_editComment($args) {
    3109                 $this->escape($args);
     3263        public function wp_editComment( $args ) {
     3264                $this->escape( $args );
    31103265
    31113266                $username       = $args[1];
    31123267                $password       = $args[2];
     
    31853340         *
    31863341         * @since 2.7.0
    31873342         *
    3188          * @param array $args Method parameters.
     3343         * @param array  $args {
     3344         *     Method parameters, in this order:
     3345         *
     3346         *     @type int        $blog_id (unused)
     3347         *     @type string     $username
     3348         *     @type string     $password
     3349         *     @type string|int $post
     3350         *     @type array      $content_struct
     3351         * }
    31893352         * @return int|IXR_Error {@link wp_new_comment()}
    31903353         */
    31913354        public function wp_newComment($args) {
    31923355                $this->escape($args);
    31933356
    3194                 $username       = $args[1];
    3195                 $password       = $args[2];
    3196                 $post           = $args[3];
     3357                $username       = $args[1];
     3358                $password       = $args[2];
     3359                $post           = $args[3];
    31973360                $content_struct = $args[4];
    31983361
    31993362                /**
     
    32883451         *
    32893452         * @since 2.7.0
    32903453         *
    3291          * @param array $args Method parameters.
     3454         * @param array  $args {
     3455         *     Method parameters, in this order:
     3456         *
     3457         *     @type int    $blog_id (unused)
     3458         *     @type string $username
     3459         *     @type string $password
     3460         * }
    32923461         * @return array|IXR_Error
    32933462         */
    32943463        public function wp_getCommentStatusList($args) {
    32953464                $this->escape( $args );
    32963465
    3297                 $username       = $args[1];
    3298                 $password       = $args[2];
     3466                $username = $args[1];
     3467                $password = $args[2];
    32993468
    33003469                if ( !$user = $this->login($username, $password) )
    33013470                        return $this->error;
     
    33143483         *
    33153484         * @since 2.5.0
    33163485         *
    3317          * @param array $args Method parameters.
     3486         * @param array  $args {
     3487         *     Method parameters, in this order:
     3488         *
     3489         *     @type int    $blog_id (unused)
     3490         *     @type string $username
     3491         *     @type string $password
     3492         *     @type int    $post_id
     3493         * }
    33183494         * @return array|IXR_Error
    33193495         */
    33203496        public function wp_getCommentCount( $args ) {
    3321                 $this->escape($args);
     3497                $this->escape( $args );
    33223498
    33233499                $username       = $args[1];
    33243500                $password       = $args[2];
     
    33473523         *
    33483524         * @since 2.5.0
    33493525         *
    3350          * @param array $args Method parameters.
     3526         * @param array  $args {
     3527         *     Method parameters, in this order:
     3528         *
     3529         *     @type int    $blog_id (unused)
     3530         *     @type string $username
     3531         *     @type string $password
     3532         * }
    33513533         * @return array|IXR_Error
    33523534         */
    33533535        public function wp_getPostStatusList( $args ) {
    33543536                $this->escape( $args );
    33553537
    3356                 $username       = $args[1];
    3357                 $password       = $args[2];
     3538                $username = $args[1];
     3539                $password = $args[2];
    33583540
    33593541                if ( !$user = $this->login($username, $password) )
    33603542                        return $this->error;
     
    33733555         *
    33743556         * @since 2.5.0
    33753557         *
    3376          * @param array $args Method parameters.
     3558         * @param array  $args {
     3559         *     Method parameters, in this order:
     3560         *
     3561         *     @type int    $blog_id (unused)
     3562         *     @type string $username
     3563         *     @type string $password
     3564         * }
    33773565         * @return array|IXR_Error
    33783566         */
    33793567        public function wp_getPageStatusList( $args ) {
    33803568                $this->escape( $args );
    33813569
    3382                 $username       = $args[1];
    3383                 $password       = $args[2];
     3570                $username = $args[1];
     3571                $password = $args[2];
    33843572
    33853573                if ( !$user = $this->login($username, $password) )
    33863574                        return $this->error;
     
    33993587         *
    34003588         * @since 2.6.0
    34013589         *
    3402          * @param array $args Method parameters.
     3590         * @param array  $args {
     3591         *     Method parameters, in this order:
     3592         *
     3593         *     @type int    $blog_id (unused)
     3594         *     @type string $username
     3595         *     @type string $password
     3596         * }
    34033597         * @return array|IXR_Error
    34043598         */
    34053599        public function wp_getPageTemplates( $args ) {
    34063600                $this->escape( $args );
    34073601
    3408                 $username       = $args[1];
    3409                 $password       = $args[2];
     3602                $username = $args[1];
     3603                $password = $args[2];
    34103604
    34113605                if ( !$user = $this->login($username, $password) )
    34123606                        return $this->error;
     
    34253619         *
    34263620         * @since 2.6.0
    34273621         *
    3428          * @param array $args Method parameters.
     3622         * @param array  $args {
     3623         *     Method parameters, in this order:
     3624         *
     3625         *     @type int    $blog_id (unused)
     3626         *     @type string $username
     3627         *     @type string $password
     3628         *     @type array  $options
     3629         * }
    34293630         * @return array|IXR_Error
    34303631         */
    34313632        public function wp_getOptions( $args ) {
     
    34783679         *
    34793680         * @since 2.6.0
    34803681         *
    3481          * @param array $args Method parameters.
     3682         * @param array  $args {
     3683         *     Method parameters, in this order:
     3684         *
     3685         *     @type int    $blog_id (unused)
     3686         *     @type string $username
     3687         *     @type string $password
     3688         *     @type array  $options
     3689         * }
    34823690         * @return array|IXR_Error
    34833691         */
    34843692        public function wp_setOptions( $args ) {
     
    35153723         *
    35163724         * @since 3.1.0
    35173725         *
    3518          * @param array $args Method parameters. Contains:
    3519          *  - blog_id (unused)
    3520          *  - username
    3521          *  - password
    3522          *  - attachment_id
     3726         * @param array  $args {
     3727         *     Method parameters, in this order:
     3728         *
     3729         *     @type int    $blog_id (unused)
     3730         *     @type string $username
     3731         *     @type string $password
     3732         *     @type int    $attachment_id
     3733         * }
    35233734         * @return array|IXR_Error Associative array contains:
    35243735         *  - 'date_created_gmt'
    35253736         *  - 'parent'
     
    35303741         *  - 'description'
    35313742         *  - 'metadata'
    35323743         */
    3533         public function wp_getMediaItem($args) {
    3534                 $this->escape($args);
     3744        public function wp_getMediaItem( $args ) {
     3745                $this->escape( $args );
    35353746
    35363747                $username               = $args[1];
    35373748                $password               = $args[2];
     
    35683779         *
    35693780         * @since 3.1.0
    35703781         *
    3571          * @param array $args Method parameters. Contains:
    3572          *  - blog_id (unused)
    3573          *  - username
    3574          *  - password
    3575          *  - filter
     3782         * @param array  $args {
     3783         *     Method parameters, in this order:
     3784         *
     3785         *     @type int    $blog_id (unused)
     3786         *     @type string $username
     3787         *     @type string $password
     3788         *     @type array  $struct
     3789         * }
    35763790         * @return array|IXR_Error Contains a collection of media items. See {@link wp_xmlrpc_server::wp_getMediaItem()} for a description of each item contents
    35773791         */
    35783792        public function wp_getMediaLibrary($args) {
     
    36113825          *
    36123826          * @since 3.1.0
    36133827          *
    3614           * @param array $args Method parameters. Contains:
    3615           *  - blog_id (unused)
    3616           *  - username
    3617           *  - password
     3828         * @param array  $args {
     3829         *     Method parameters, in this order:
     3830         *
     3831         *     @type int    $blog_id (unused)
     3832         *     @type string $username
     3833         *     @type string $password
     3834         * }
    36183835          * @return array|IXR_Error
    36193836          */
    36203837        public function wp_getPostFormats( $args ) {
     
    36583875         * @since 3.4.0
    36593876         *
    36603877         * @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
     3878         * @param array  $args {
     3879         *     Method parameters, in this order:
     3880         *
     3881         *     @type int    $blog_id (unused)
     3882         *     @type string $username
     3883         *     @type string $password
     3884         *     @type string $post_type_name
     3885         *     @type array  $fields (optional)
     3886         * }
    36673887         * @return array|IXR_Error Array contains:
    36683888         *  - 'labels'
    36693889         *  - 'description'
     
    37223942         * @since 3.4.0
    37233943         *
    37243944         * @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
     3945         * @param array  $args {
     3946         *     Method parameters, in this order:
     3947         *
     3948         *     @type int    $blog_id (unused)
     3949         *     @type string $username
     3950         *     @type string $password
     3951         *     @type array  $filter (optional)
     3952         *     @type array  $fields (optional)
     3953         * }
    37313954         * @return array|IXR_Error
    37323955         */
    37333956        public function wp_getPostTypes( $args ) {
     
    37363959
    37373960                $this->escape( $args );
    37383961
    3739                 $username           = $args[1];
    3740                 $password           = $args[2];
    3741                 $filter             = isset( $args[3] ) ? $args[3] : array( 'public' => true );
     3962                $username = $args[1];
     3963                $password = $args[2];
     3964                $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
    37423965
    37433966                if ( isset( $args[4] ) ) {
    37443967                        $fields = $args[4];
     
    37784001         * @uses wp_get_post_revisions()
    37794002         * @see wp_getPost() for more on $fields
    37804003         *
    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
     4004         * @param array  $args {
     4005         *     Method parameters, in this order:
     4006         *
     4007         *     @type int    $blog_id (unused)
     4008         *     @type string $username
     4009         *     @type string $password
     4010         *     @type int    $post_id
     4011         *     @type array  $fields (optional)
     4012         * }
    37874013         * @return array|IXR_Error contains a collection of posts.
    37884014         */
    37894015        public function wp_getRevisions( $args ) {
     
    37924018
    37934019                $this->escape( $args );
    37944020
    3795                 $username   = $args[1];
    3796                 $password   = $args[2];
    3797                 $post_id    = (int) $args[3];
     4021                $username = $args[1];
     4022                $password = $args[2];
     4023                $post_id  = (int) $args[3];
    37984024
    37994025                if ( isset( $args[4] ) ) {
    38004026                        $fields = $args[4];
     
    38544080         *
    38554081         * @uses wp_restore_post_revision()
    38564082         *
    3857          * @param array $args Method parameters. Contains:
    3858          *  - int     $blog_id (unused)
    3859          *  - string  $username
    3860          *  - string  $password
    3861          *  - int     $post_id
     4083         * @param array  $args {
     4084         *     Method parameters, in this order:
     4085         *
     4086         *     @type int    $blog_id (unused)
     4087         *     @type string $username
     4088         *     @type string $password
     4089         *     @type int    $revision_id
     4090         * }
    38624091         * @return bool|IXR_Error false if there was an error restoring, true if success.
    38634092         */
    38644093        public function wp_restoreRevision( $args ) {
     
    39094138         *
    39104139         * @since 1.5.0
    39114140         *
    3912          * @param array $args Method parameters.
     4141         * @param array  $args {
     4142         *     Method parameters, in this order:
     4143         *
     4144         *     @type int    $blog_id (unused)
     4145         *     @type string $username
     4146         *     @type string $password
     4147         * }
    39134148         * @return array|IXR_Error
    39144149         */
    39154150        public function blogger_getUsersBlogs($args) {
     
    39194154                $this->escape($args);
    39204155
    39214156                $username = $args[1];
    3922                 $password  = $args[2];
     4157                $password = $args[2];
    39234158
    39244159                if ( !$user = $this->login($username, $password) )
    39254160                        return $this->error;
     
    39784213         *
    39794214         * @since 1.5.0
    39804215         *
    3981          * @param array $args Method parameters.
     4216         * @param array  $args {
     4217         *     Method parameters, in this order:
     4218         *
     4219         *     @type int    $blog_id (unused)
     4220         *     @type string $username
     4221         *     @type string $password
     4222         * }
    39824223         * @return array|IXR_Error
    39834224         */
    3984         public function blogger_getUserInfo($args) {
     4225        public function blogger_getUserInfo( $args ) {
     4226                $this->escape( $args );
    39854227
    3986                 $this->escape($args);
    3987 
    39884228                $username = $args[1];
    3989                 $password  = $args[2];
     4229                $password = $args[2];
    39904230
    39914231                if ( !$user = $this->login($username, $password) )
    39924232                        return $this->error;
     
    40134253         *
    40144254         * @since 1.5.0
    40154255         *
    4016          * @param array $args Method parameters.
     4256         * @param array  $args {
     4257         *     Method parameters, in this order:
     4258         *
     4259         *     @type int    $blog_id (unused)
     4260         *     @type int    $post_ID
     4261         *     @type string $username
     4262         *     @type string $password
     4263         * }
    40174264         * @return array|IXR_Error
    40184265         */
    4019         public function blogger_getPost($args) {
     4266        public function blogger_getPost( $args ) {
     4267                $this->escape( $args );
    40204268
    4021                 $this->escape($args);
    4022 
    4023                 $post_ID    = (int) $args[1];
     4269                $post_ID  = (int) $args[1];
    40244270                $username = $args[2];
    4025                 $password  = $args[3];
     4271                $password = $args[3];
    40264272
    40274273                if ( !$user = $this->login($username, $password) )
    40284274                        return $this->error;
     
    40584304         *
    40594305         * @since 1.5.0
    40604306         *
    4061          * @param array $args Method parameters.
     4307         * @param array  $args {
     4308         *     Method parameters, in this order:
     4309         *
     4310         *     @type string $appkey (unused)
     4311         *     @type int    $blog_id (unused)
     4312         *     @type string $username
     4313         *     @type string $password
     4314         *     @type int    $numberposts (optional)
     4315         * }
    40624316         * @return array|IXR_Error
    40634317         */
    4064         public function blogger_getRecentPosts($args) {
     4318        public function blogger_getRecentPosts( $args ) {
    40654319
    40664320                $this->escape($args);
    40674321
    40684322                // $args[0] = appkey - ignored
    40694323                $username = $args[2];
    4070                 $password  = $args[3];
     4324                $password = $args[3];
    40714325                if ( isset( $args[4] ) )
    40724326                        $query = array( 'numberposts' => absint( $args[4] ) );
    40734327                else
     
    41394393         *
    41404394         * @since 1.5.0
    41414395         *
    4142          * @param array $args Method parameters.
     4396         * @param array  $args {
     4397         *     Method parameters, in this order:
     4398         *
     4399         *     @type string $appkey (unused)
     4400         *     @type int    $blog_id (unused)
     4401         *     @type string $username
     4402         *     @type string $password
     4403         *     @type string $content
     4404         *     @type string $publish
     4405         * }
    41434406         * @return int|IXR_Error
    41444407         */
    4145         public function blogger_newPost($args) {
     4408        public function blogger_newPost( $args ) {
     4409                $this->escape( $args );
    41464410
    4147                 $this->escape($args);
    4148 
    41494411                $username = $args[2];
    4150                 $password  = $args[3];
    4151                 $content    = $args[4];
    4152                 $publish    = $args[5];
     4412                $password = $args[3];
     4413                $content  = $args[4];
     4414                $publish  = $args[5];
    41534415
    41544416                if ( !$user = $this->login($username, $password) )
    41554417                        return $this->error;
     
    42014463         *
    42024464         * @since 1.5.0
    42034465         *
    4204          * @param array $args Method parameters.
    4205          * @return bool|IXR_Error true when done.
     4466         * @param array  $args {
     4467         *     Method parameters, in this order:
     4468         *
     4469         *     @type int    $blog_id (unused)
     4470         *     @type int    $post_ID
     4471         *     @type string $username
     4472         *     @type string $password
     4473         *     @type string $content
     4474         * }
     4475         * @return true|IXR_Error true when done.
    42064476         */
    42074477        public function blogger_editPost( $args ) {
    42084478
    42094479                $this->escape($args);
    42104480
    4211                 $post_ID     = (int) $args[1];
    4212                 $username  = $args[2];
    4213                 $password   = $args[3];
    4214                 $content     = $args[4];
     4481                $post_ID  = (int) $args[1];
     4482                $username = $args[2];
     4483                $password = $args[3];
     4484                $content  = $args[4];
    42154485
    42164486                if ( ! $user = $this->login( $username, $password ) ) {
    42174487                        return $this->error;
     
    42684538         *
    42694539         * @since 1.5.0
    42704540         *
    4271          * @param array $args Method parameters.
    4272          * @return bool|IXR_Error True when post is deleted.
     4541         * @param array  $args {
     4542         *     Method parameters, in this order:
     4543         *
     4544         *     @type int    $blog_id (unused)
     4545         *     @type int    $post_ID
     4546         *     @type string $username
     4547         *     @type string $password
     4548         * }
     4549         * @return true|IXR_Error True when post is deleted.
    42734550         */
    4274         public function blogger_deletePost($args) {
    4275                 $this->escape($args);
     4551        public function blogger_deletePost( $args ) {
     4552                $this->escape( $args );
    42764553
    4277                 $post_ID     = (int) $args[1];
    4278                 $username  = $args[2];
    4279                 $password   = $args[3];
     4554                $post_ID  = (int) $args[1];
     4555                $username = $args[2];
     4556                $password = $args[3];
    42804557
    42814558                if ( !$user = $this->login($username, $password) )
    42824559                        return $this->error;
     
    43414618         *
    43424619         * @since 1.5.0
    43434620         *
    4344          * @param array $args Method parameters. Contains:
    4345          *  - blog_id (unused)
    4346          *  - username
    4347          *  - password
    4348          *  - content_struct
    4349          *  - publish
     4621         * @param array  $args {
     4622         *     Method parameters, in this order:
     4623         *
     4624         *     @type int    $blog_id (unused)
     4625         *     @type string $username
     4626         *     @type string $password
     4627         *     @type array  $content_struct
     4628         *     @type int    $publish
     4629         * }
    43504630         * @return int|IXR_Error
    43514631         */
    43524632        public function mw_newPost($args) {
    43534633                $this->escape($args);
    43544634
    4355                 $username  = $args[1];
    4356                 $password   = $args[2];
     4635                $username       = $args[1];
     4636                $password       = $args[2];
    43574637                $content_struct = $args[3];
    4358                 $publish     = isset( $args[4] ) ? $args[4] : 0;
     4638                $publish        = isset( $args[4] ) ? $args[4] : 0;
    43594639
    43604640                if ( !$user = $this->login($username, $password) )
    43614641                        return $this->error;
     
    46544934         *
    46554935         * @since 2.1.0
    46564936         *
     4937         * @global wpdb $wpdb
     4938         *
    46574939         * @param int $post_ID Post ID.
    46584940         * @param string $post_content Post Content for attachment.
    46594941         */
     
    46754957         *
    46764958         * @since 1.5.0
    46774959         *
    4678          * @param array $args Method parameters.
     4960         * @param array  $args {
     4961         *     Method parameters, in this order:
     4962         *
     4963         *     @type int    $blog_id (unused)
     4964         *     @type string $username
     4965         *     @type string $password
     4966         *     @type array  $content_struct
     4967         *     @type int    $publish
     4968         * }
    46794969         * @return bool|IXR_Error True on success.
    46804970         */
    4681         public function mw_editPost($args) {
     4971        public function mw_editPost( $args ) {
     4972                $this->escape( $args );
    46824973
    4683                 $this->escape($args);
    4684 
    46854974                $post_ID        = (int) $args[0];
    46864975                $username       = $args[1];
    46874976                $password       = $args[2];
     
    49675256         *
    49685257         * @since 1.5.0
    49695258         *
    4970          * @param array $args Method parameters.
     5259         * @param array  $args {
     5260         *     Method parameters, in this order:
     5261         *
     5262         *     @type int    $blog_id (unused)
     5263         *     @type int    $post_ID
     5264         *     @type string $username
     5265         *     @type string $password
     5266         * }
    49715267         * @return array|IXR_Error
    49725268         */
    4973         public function mw_getPost($args) {
     5269        public function mw_getPost( $args ) {
     5270                $this->escape( $args );
    49745271
    4975                 $this->escape($args);
     5272                $post_ID  = (int) $args[0];
     5273                $username = $args[1];
     5274                $password = $args[2];
    49765275
    4977                 $post_ID     = (int) $args[0];
    4978                 $username  = $args[1];
    4979                 $password   = $args[2];
    4980 
    49815276                if ( !$user = $this->login($username, $password) )
    49825277                        return $this->error;
    49835278
     
    50925387         *
    50935388         * @since 1.5.0
    50945389         *
    5095          * @param array $args Method parameters.
     5390         * @param array  $args {
     5391         *     Method parameters, in this order:
     5392         *
     5393         *     @type int    $blog_id (unused)
     5394         *     @type string $username
     5395         *     @type string $password
     5396         *     @type int    $numberposts
     5397         * }
    50965398         * @return array|IXR_Error
    50975399         */
    5098         public function mw_getRecentPosts($args) {
     5400        public function mw_getRecentPosts( $args ) {
     5401                $this->escape( $args );
    50995402
    5100                 $this->escape($args);
    5101 
    5102                 $username  = $args[1];
    5103                 $password   = $args[2];
     5403                $username = $args[1];
     5404                $password = $args[2];
    51045405                if ( isset( $args[3] ) )
    51055406                        $query = array( 'numberposts' => absint( $args[3] ) );
    51065407                else
     
    52045505         *
    52055506         * @since 1.5.0
    52065507         *
    5207          * @param array $args Method parameters.
     5508         * @param array  $args {
     5509         *     Method parameters, in this order:
     5510         *
     5511         *     @type int    $blog_id (unused)
     5512         *     @type string $username
     5513         *     @type string $password
     5514         * }
    52085515         * @return array|IXR_Error
    52095516         */
    5210         public function mw_getCategories($args) {
     5517        public function mw_getCategories( $args ) {
     5518                $this->escape( $args );
    52115519
    5212                 $this->escape($args);
     5520                $username = $args[1];
     5521                $password = $args[2];
    52135522
    5214                 $username  = $args[1];
    5215                 $password   = $args[2];
    5216 
    52175523                if ( !$user = $this->login($username, $password) )
    52185524                        return $this->error;
    52195525
     
    52525558         *
    52535559         * @since 1.5.0
    52545560         *
    5255          * @param array $args Method parameters.
     5561         * @global wpdb $wpdb
     5562         *
     5563         * @param array  $args {
     5564         *     Method parameters, in this order:
     5565         *
     5566         *     @type int    $blog_id (unused)
     5567         *     @type string $username
     5568         *     @type string $password
     5569         *     @type array  $data
     5570         * }
    52565571         * @return array|IXR_Error
    52575572         */
    5258         public function mw_newMediaObject($args) {
     5573        public function mw_newMediaObject( $args ) {
    52595574                global $wpdb;
    52605575
    5261                 $username  = $this->escape($args[1]);
    5262                 $password   = $this->escape($args[2]);
    5263                 $data        = $args[3];
     5576                $username = $this->escape( $args[1] );
     5577                $password = $this->escape( $args[2] );
     5578                $data     = $args[3];
    52645579
    52655580                $name = sanitize_file_name( $data['name'] );
    52665581                $type = $data['type'];
     
    53655680         *
    53665681         * @since 1.5.0
    53675682         *
    5368          * @param array $args Method parameters.
     5683         * @param array  $args {
     5684         *     Method parameters, in this order:
     5685         *
     5686         *     @type int    $blog_id (unused)
     5687         *     @type string $username
     5688         *     @type string $password
     5689         *     @type int    $numberposts
     5690         * }
    53695691         * @return array|IXR_Error
    53705692         */
    5371         public function mt_getRecentPostTitles($args) {
     5693        public function mt_getRecentPostTitles( $args ) {
     5694                $this->escape( $args );
    53725695
    5373                 $this->escape($args);
    5374 
    5375                 $username  = $args[1];
    5376                 $password   = $args[2];
     5696                $username = $args[1];
     5697                $password = $args[2];
    53775698                if ( isset( $args[3] ) )
    53785699                        $query = array( 'numberposts' => absint( $args[3] ) );
    53795700                else
     
    54195740         *
    54205741         * @since 1.5.0
    54215742         *
    5422          * @param array $args Method parameters.
     5743         * @param array  $args {
     5744         *     Method parameters, in this order:
     5745         *
     5746         *     @type int    $blog_id (unused)
     5747         *     @type string $username
     5748         *     @type string $password
     5749         * }
    54235750         * @return array|IXR_Error
    54245751         */
    5425         public function mt_getCategoryList($args) {
     5752        public function mt_getCategoryList( $args ) {
     5753                $this->escape( $args );
    54265754
    5427                 $this->escape($args);
     5755                $username = $args[1];
     5756                $password = $args[2];
    54285757
    5429                 $username  = $args[1];
    5430                 $password   = $args[2];
    5431 
    54325758                if ( !$user = $this->login($username, $password) )
    54335759                        return $this->error;
    54345760
     
    54585784         *
    54595785         * @since 1.5.0
    54605786         *
    5461          * @param array $args Method parameters.
     5787         * @param array  $args {
     5788         *     Method parameters, in this order:
     5789         *
     5790         *     @type int    $post_ID
     5791         *     @type string $username
     5792         *     @type string $password
     5793         * }
    54625794         * @return array|IXR_Error
    54635795         */
    5464         public function mt_getPostCategories($args) {
     5796        public function mt_getPostCategories( $args ) {
     5797                $this->escape( $args );
    54655798
    5466                 $this->escape($args);
     5799                $post_ID  = (int) $args[0];
     5800                $username = $args[1];
     5801                $password = $args[2];
    54675802
    5468                 $post_ID     = (int) $args[0];
    5469                 $username  = $args[1];
    5470                 $password   = $args[2];
    5471 
    54725803                if ( !$user = $this->login($username, $password) )
    54735804                        return $this->error;
    54745805
     
    55025833         *
    55035834         * @since 1.5.0
    55045835         *
    5505          * @param array $args Method parameters.
    5506          * @return bool|IXR_Error True on success.
     5836         * @param array  $args {
     5837         *     Method parameters, in this order:
     5838         *
     5839         *     @type int    $post_ID
     5840         *     @type string $username
     5841         *     @type string $password
     5842         *     @type array  $categories
     5843         * }
     5844         * @return true|IXR_Error True on success.
    55075845         */
    5508         public function mt_setPostCategories($args) {
     5846        public function mt_setPostCategories( $args ) {
     5847                $this->escape( $args );
    55095848
    5510                 $this->escape($args);
    5511 
    5512                 $post_ID     = (int) $args[0];
    5513                 $username  = $args[1];
     5849                $post_ID    = (int) $args[0];
     5850                $username   = $args[1];
    55145851                $password   = $args[2];
    5515                 $categories  = $args[3];
     5852                $categories = $args[3];
    55165853
    55175854                if ( !$user = $this->login($username, $password) )
    55185855                        return $this->error;
     
    55415878         *
    55425879         * @since 1.5.0
    55435880         *
    5544          * @param array $args Method parameters.
    55455881         * @return array
    55465882         */
    5547         public function mt_supportedMethods($args) {
    5548 
     5883        public function mt_supportedMethods() {
    55495884                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    55505885                do_action( 'xmlrpc_call', 'mt.supportedMethods' );
    55515886
    5552                 $supported_methods = array();
    5553                 foreach ( $this->methods as $key => $value ) {
    5554                         $supported_methods[] = $key;
    5555                 }
    5556 
    5557                 return $supported_methods;
     5887                return array_keys( $this->methods );
    55585888        }
    55595889
    55605890        /**
     
    55615891         * Retrieve an empty array because we don't support per-post text filters.
    55625892         *
    55635893         * @since 1.5.0
    5564          *
    5565          * @param array $args Method parameters.
    55665894         */
    5567         public function mt_supportedTextFilters($args) {
     5895        public function mt_supportedTextFilters() {
    55685896                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    55695897                do_action( 'xmlrpc_call', 'mt.supportedTextFilters' );
    55705898
     
    55835911         *
    55845912         * @since 1.5.0
    55855913         *
    5586          * @param array $args Method parameters.
     5914         * @global wpdb $wpdb
     5915         *
     5916         * @param int $post_ID
    55875917         * @return array|IXR_Error
    55885918         */
    5589         public function mt_getTrackbackPings($args) {
    5590 
     5919        public function mt_getTrackbackPings( $post_ID ) {
    55915920                global $wpdb;
    55925921
    5593                 $post_ID = intval($args);
    5594 
    55955922                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    55965923                do_action( 'xmlrpc_call', 'mt.getTrackbackPings' );
    55975924
     
    56265953         *
    56275954         * @since 1.5.0
    56285955         *
    5629          * @param array $args Method parameters.
     5956         * @param array  $args {
     5957         *     Method parameters, in this order:
     5958         *
     5959         *     @type int    $post_ID
     5960         *     @type string $username
     5961         *     @type string $password
     5962         * }
    56305963         * @return int|IXR_Error
    56315964         */
    5632         public function mt_publishPost($args) {
     5965        public function mt_publishPost( $args ) {
     5966                $this->escape( $args );
    56335967
    5634                 $this->escape($args);
     5968                $post_ID  = (int) $args[0];
     5969                $username = $args[1];
     5970                $password = $args[2];
    56355971
    5636                 $post_ID     = (int) $args[0];
    5637                 $username  = $args[1];
    5638                 $password   = $args[2];
    5639 
    56405972                if ( !$user = $this->login($username, $password) )
    56415973                        return $this->error;
    56425974
     
    56575989                $postdata['post_category'] = $cats;
    56585990                $this->escape($postdata);
    56595991
    5660                 $result = wp_update_post($postdata);
    5661 
    5662                 return $result;
     5992                return wp_update_post( $postdata );
    56635993        }
    56645994
    56655995        /* PingBack functions
     
    56716001         *
    56726002         * @since 1.5.0
    56736003         *
    5674          * @param array $args Method parameters.
     6004         * @global wpdb $wpdb
     6005         * @global string $wp_version
     6006         *
     6007         * @param array  $args {
     6008         *     Method parameters, in this order:
     6009         *
     6010         *     @type string $pagelinkedfrom
     6011         *     @type string $pagelinkedto
     6012         * }
    56756013         * @return string|IXR_Error
    56766014         */
    5677         public function pingback_ping($args) {
    5678                 global $wpdb;
     6015        public function pingback_ping( $args ) {
     6016                global $wpdb, $wp_version;
    56796017
    56806018                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    56816019                do_action( 'xmlrpc_call', 'pingback.ping' );
    56826020
    5683                 $this->escape($args);
     6021                $this->escape( $args );
    56846022
    5685                 $pagelinkedfrom = $args[0];
    5686                 $pagelinkedto   = $args[1];
     6023                $pagelinkedfrom = str_replace( '&amp;', '&', $args[0] );
     6024                $pagelinkedto = str_replace( '&amp;', '&', $args[1] );
     6025                $pagelinkedto = str_replace( '&', '&amp;', $pagelinkedto );
    56876026
    5688                 $pagelinkedfrom = str_replace('&amp;', '&', $pagelinkedfrom);
    5689                 $pagelinkedto = str_replace('&amp;', '&', $pagelinkedto);
    5690                 $pagelinkedto = str_replace('&', '&amp;', $pagelinkedto);
    5691 
    56926027                /**
    56936028                 * Filter the pingback source URI.
    56946029                 *
     
    57666101                $remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
    57676102
    57686103                /** 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' ) );
     6104                $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
    57706105
    57716106                // Let's check the remote site
    57726107                $http_api_args = array(
     
    58776212         *
    58786213         * @since 1.5.0
    58796214         *
    5880          * @param array $args Method parameters.
     6215         * @global wpdb $wpdb
     6216         *
     6217         * @param string $url
    58816218         * @return array|IXR_Error
    58826219         */
    5883         public function pingback_extensions_getPingbacks($args) {
    5884 
     6220        public function pingback_extensions_getPingbacks( $url ) {
    58856221                global $wpdb;
    58866222
    58876223                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    58886224                do_action( 'xmlrpc_call', 'pingback.extensions.getPingbacks' );
    58896225
    5890                 $this->escape($args);
     6226                $url = $this->escape( $url );
    58916227
    5892                 $url = $args;
    5893 
    58946228                $post_ID = url_to_postid($url);
    58956229                if ( !$post_ID ) {
    58966230                        // We aren't sure that the resource is available and/or pingback enabled
     
    59216255        /**
    59226256         * @param integer $code
    59236257         * @param string $message
     6258         * @return IXR_Error
    59246259         */
    59256260        protected function pingback_error( $code, $message ) {
    59266261                /**