Make WordPress Core

Ticket #7550: 7550.r8947.diff

File 7550.r8947.diff, 24.6 KB (added by jacobsantos, 15 years ago)

Completion and fixes for base file inline documentation based off of r8947

  • wp-app.php

     
    6767
    6868if ( !function_exists('wp_set_current_user') ) :
    6969/**
    70  * wp_set_current_user() - Sets the current WordPress User
     70 * Sets the current WordPress User.
    7171 *
    7272 * Pluggable function which is also found in pluggable.php.
    7373 *
    7474 * @see wp-includes/pluggable.php Documentation for this function.
    7575 * @uses $current_user Global of current user to test whether $id is the same.
    7676 *
    77  * @param int $id The user's ID
     77 * @param int $id The user's ID.
    7878 * @param string $name Optional. The username of the user.
    7979 * @return WP_User Current user's User object
    8080 */
     
    9191endif;
    9292
    9393/**
    94  * wa_posts_where_include_drafts_filter() - Filter to add more post statuses
     94 * Filter to add more post statuses.
    9595 *
    9696 * @param string $where SQL statement to filter
    9797 * @return string Filtered SQL statement with added post_status for where clause
     
    104104add_filter('posts_where', 'wa_posts_where_include_drafts_filter');
    105105
    106106/**
    107  * @internal
    108  * Left undocumented to work on later. If you want to finish, then please do so.
     107 * WordPress AtomPub API implementation.
    109108 *
    110109 * @package WordPress
    111110 * @subpackage Publishing
     111 * @since 2.2.0
    112112 */
    113113class AtomServer {
    114114
  • wp-login.php

     
    2323}
    2424
    2525/**
    26  * login_header() - Outputs the header for the login page
     26 * Outputs the header for the login page.
    2727 *
    28  * @package WordPress
    2928 * @uses do_action() Calls the 'login_head' for outputting HTML in the Login
    3029 *              header.
    3130 * @uses apply_filters() Calls 'login_headerurl' for the top login link.
     
    8786} // End of login_header()
    8887
    8988/**
    90  * retrieve_password() - Handles sending password retrieval email to user
     89 * Handles sending password retrieval email to user.
    9190 *
    92  * {@internal Missing Long Description}}
    93  *
    9491 * @uses $wpdb WordPress Database object
    9592 *
    9693 * @return bool|WP_Error True: when finish. WP_Error on error
     
    157154}
    158155
    159156/**
    160  * reset_password() - Handles resetting the user's password
     157 * Handles resetting the user's password.
    161158 *
    162  * {@internal Missing Long Description}}
    163  *
    164159 * @uses $wpdb WordPress Database object
    165160 *
    166161 * @param string $key Hash to validate sending user's password
     
    196191}
    197192
    198193/**
    199  * register_new_user() - Handles registering a new user
     194 * Handles registering a new user.
    200195 *
    201  * {@internal Missing Long Description}}
    202  *
    203196 * @param string $user_login User's username for logging in
    204197 * @param string $user_email User's email address to send password and add
    205198 * @return int|WP_Error Either user's ID or error on failure.
  • xmlrpc.php

     
    9999        logIO("I", $HTTP_RAW_POST_DATA);
    100100
    101101/**
    102  * @internal
    103  * Left undocumented to work on later. If you want to finish, then please do so.
     102 * WordPress XMLRPC server implementation.
    104103 *
     104 * Implements compatability for Blogger API, MetaWeblog API, MovableType, and
     105 * pingback. Additional WordPress API for managing comments, pages, posts,
     106 * options, etc.
     107 *
     108 * Since WordPress 2.6.0, WordPress XMLRPC server can be disabled in the
     109 * administration panels.
     110 *
    105111 * @package WordPress
    106112 * @subpackage Publishing
     113 * @since 1.5.0
    107114 */
    108115class wp_xmlrpc_server extends IXR_Server {
    109116
     117        /**
     118         * Register all of the XMLRPC methods that XMLRPC server understands.
     119         *
     120         * PHP4 constructor and sets up server and method property. Passes XMLRPC
     121         * methods through the 'xmlrpc_methods' filter to allow plugins to extend
     122         * or replace XMLRPC methods.
     123         *
     124         * @since 1.5.0
     125         *
     126         * @return wp_xmlrpc_server
     127         */
    110128        function wp_xmlrpc_server() {
    111129                $this->methods = array(
    112130                        // WordPress API
     
    185203                $this->IXR_Server($this->methods);
    186204        }
    187205
     206        /**
     207         * Test XMLRPC API by saying, "Hello!" to client.
     208         *
     209         * @since 1.5.0
     210         *
     211         * @param array $args Method Parameters.
     212         * @return string
     213         */
    188214        function sayHello($args) {
    189215                return 'Hello!';
    190216        }
    191217
     218        /**
     219         * Test XMLRPC API by adding two numbers for client.
     220         *
     221         * @since 1.5.0
     222         *
     223         * @param array $args Method Parameters.
     224         * @return int
     225         */
    192226        function addTwoNumbers($args) {
    193227                $number1 = $args[0];
    194228                $number2 = $args[1];
    195229                return $number1 + $number2;
    196230        }
    197231
     232        /**
     233         * Check user's credentials.
     234         *
     235         * @since 1.5.0
     236         *
     237         * @param string $user_login User's username.
     238         * @param string $user_pass User's password.
     239         * @return bool Whether authentication passed.
     240         */
    198241        function login_pass_ok($user_login, $user_pass) {
    199242                if ( !get_option( 'enable_xmlrpc' ) ) {
    200243                        $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this blog.  An admin user can enable them at %s'),  admin_url('options-writing.php') ) );
     
    208251                return true;
    209252        }
    210253
     254        /**
     255         * Sanitize string or array of strings for database.
     256         *
     257         * @since 1.5.2
     258         *
     259         * @param string|array $array Sanitize single string or array of strings.
     260         * @return string|array Type matches $array and sanitized for the database.
     261         */
    211262        function escape(&$array) {
    212263                global $wpdb;
    213264
     
    227278                }
    228279        }
    229280
     281        /**
     282         * Retrieve custom fields for post.
     283         *
     284         * @since 2.5.0
     285         *
     286         * @param int $post_id Post ID.
     287         * @return array Custom fields, if exist.
     288         */
    230289        function get_custom_fields($post_id) {
    231290                $post_id = (int) $post_id;
    232291
     
    248307                return $custom_fields;
    249308        }
    250309
     310        /**
     311         * Set custom fields for post.
     312         *
     313         * @since 2.5.0
     314         *
     315         * @param int $post_id Post ID.
     316         * @param array $fields Custom fields.
     317         */
    251318        function set_custom_fields($post_id, $fields) {
    252319                $post_id = (int) $post_id;
    253320
     
    270337                }
    271338        }
    272339
     340        /**
     341         * Setup blog options property.
     342         *
     343         * Passes property through 'xmlrpc_blog_options' filter.
     344         *
     345         * @since 2.6.0
     346         */
    273347        function initialise_blog_option_info( ) {
    274348                global $wp_version;
    275349
     
    323397        }
    324398
    325399        /**
    326          * WordPress XML-RPC API
    327          * wp_getUsersBlogs
     400         * Retrieve the blogs of the user.
     401         *
     402         * @since 2.6.0
     403         *
     404         * @param array $args Method parameters.
     405         * @return array
    328406         */
    329407        function wp_getUsersBlogs( $args ) {
    330408                // If this isn't on WPMU then just use blogger_getUsersBlogs
     
    370448        }
    371449
    372450        /**
    373          * WordPress XML-RPC API
    374          * wp_getPage
     451         * Retrieve page.
     452         *
     453         * @since 2.2.0
     454         *
     455         * @param array $args Method parameters.
     456         * @return array
    375457         */
    376458        function wp_getPage($args) {
    377459                $this->escape($args);
     
    464546        }
    465547
    466548        /**
    467          * WordPress XML-RPC API
    468          * wp_getPages
     549         * Retrieve Pages.
     550         *
     551         * @since 2.2.0
     552         *
     553         * @param array $args Method parameters.
     554         * @return array
    469555         */
    470556        function wp_getPages($args) {
    471557                $this->escape($args);
     
    508594        }
    509595
    510596        /**
    511          * WordPress XML-RPC API
    512          * wp_newPage
     597         * Create new page.
     598         *
     599         * @since 2.2.0
     600         *
     601         * @param array $args Method parameters.
     602         * @return unknown
    513603         */
    514604        function wp_newPage($args) {
    515605                // Items not escaped here will be escaped in newPost.
     
    539629        }
    540630
    541631        /**
    542          * WordPress XML-RPC API
    543          * wp_deletePage
     632         * Delete page.
     633         *
     634         * @since 2.2.0
     635         *
     636         * @param array $args Method parameters.
     637         * @return bool True, if success.
    544638         */
    545639        function wp_deletePage($args) {
    546640                $this->escape($args);
     
    582676        }
    583677
    584678        /**
    585          * WordPress XML-RPC API
    586          * wp_editPage
     679         * Edit page.
     680         *
     681         * @since 2.2.0
     682         *
     683         * @param array $args Method parameters.
     684         * @return unknown
    587685         */
    588686        function wp_editPage($args) {
    589687                // Items not escaped here will be escaped in editPost.
     
    632730        }
    633731
    634732        /**
    635          * WordPress XML-RPC API
    636          * wp_getPageList
     733         * Retrieve page list.
     734         *
     735         * @since 2.2.0
     736         *
     737         * @param array $args Method parameters.
     738         * @return unknown
    637739         */
    638740        function wp_getPageList($args) {
    639741                global $wpdb;
     
    683785        }
    684786
    685787        /**
    686          * WordPress XML-RPC API
    687          * wp_getAuthors
     788         * Retrieve authors list.
     789         *
     790         * @since 2.2.0
     791         *
     792         * @param array $args Method parameters.
     793         * @return array
    688794         */
    689795        function wp_getAuthors($args) {
    690796
     
    701807                set_current_user(0, $username);
    702808                if(!current_user_can("edit_posts")) {
    703809                        return(new IXR_Error(401, __("Sorry, you can not edit posts on this blog.")));
    704         }
     810                }
    705811
    706812                do_action('xmlrpc_call', 'wp.getAuthors');
    707813
     
    718824        }
    719825
    720826        /**
    721          * WordPress XML-RPC API
    722          * wp_newCategory
     827         * Create new category.
     828         *
     829         * @since 2.2.0
     830         *
     831         * @param array $args Method parameters.
     832         * @return int Category ID.
    723833         */
    724834        function wp_newCategory($args) {
    725835                $this->escape($args);
     
    774884        }
    775885
    776886        /**
    777          * WordPress XML-RPC API
    778          * wp_deleteCategory
     887         * Remove category.
     888         *
     889         * @since 2.5.0
     890         *
     891         * @param array $args Method parameters.
     892         * @return mixed See {@link wp_delete_category()} for return info.
    779893         */
    780894        function wp_deleteCategory($args) {
    781895                $this->escape($args);
     
    799913                return wp_delete_category( $category_id );
    800914        }
    801915
    802 
    803916        /**
    804          * WordPress XML-RPC API
    805          * wp_suggestCategories
     917         * Retrieve category list.
     918         *
     919         * @since 2.2.0
     920         *
     921         * @param array $args Method parameters.
     922         * @return array
    806923         */
    807924        function wp_suggestCategories($args) {
    808925                $this->escape($args);
     
    835952                return($category_suggestions);
    836953        }
    837954
     955        /**
     956         * Retrieve comment.
     957         *
     958         * @since 2.7.0
     959         *
     960         * @param array $args Method parameters.
     961         * @return array
     962         */
    838963        function wp_getComment($args) {
    839964                $this->escape($args);
    840965
     
    8871012                return $comment_struct;
    8881013        }
    8891014
     1015        /**
     1016         * Retrieve comments.
     1017         *
     1018         * @since 2.7.0
     1019         *
     1020         * @param array $args Method parameters.
     1021         * @return array
     1022         */
    8901023        function wp_getComments($args) {
    8911024                $this->escape($args);
    8921025
     
    9391072                return $comments_struct;
    9401073        }
    9411074
     1075        /**
     1076         * Remove comment.
     1077         *
     1078         * @since 2.7.0
     1079         *
     1080         * @param array $args Method parameters.
     1081         * @return mixed {@link wp_delete_comment()}
     1082         */
    9421083        function wp_deleteComment($args) {
    9431084                $this->escape($args);
    9441085
     
    9621103                return wp_delete_comment($comment_ID);
    9631104        }
    9641105
     1106        /**
     1107         * Edit comment.
     1108         *
     1109         * @since 2.7.0
     1110         *
     1111         * @param array $args Method parameters.
     1112         * @return bool True, on success.
     1113         */
    9651114        function wp_editComment($args) {
    9661115                $this->escape($args);
    9671116
     
    10241173                return true;
    10251174        }
    10261175
     1176        /**
     1177         * Create new comment.
     1178         *
     1179         * @since 2.7.0
     1180         *
     1181         * @param array $args Method parameters.
     1182         * @return mixed {@link wp_new_comment()}
     1183         */
    10271184        function wp_newComment($args) {
    10281185                global $wpdb;
    10291186
     
    10981255                return wp_new_comment($comment);
    10991256        }
    11001257
     1258        /**
     1259         * Retrieve all of the comment status.
     1260         *
     1261         * @since 2.7.0
     1262         *
     1263         * @param array $args Method parameters.
     1264         * @return array
     1265         */
    11011266        function wp_getCommentStatusList($args) {
    11021267                $this->escape( $args );
    11031268
     
    11171282                return get_comment_statuses( );
    11181283        }
    11191284
     1285        /**
     1286         * Retrieve comment count.
     1287         *
     1288         * @since 2.5.0
     1289         *
     1290         * @param array $args Method parameters.
     1291         * @return array
     1292         */
    11201293        function wp_getCommentCount( $args ) {
    11211294                $this->escape($args);
    11221295
     
    11451318                );
    11461319        }
    11471320
     1321        /**
     1322         * Retrieve post statuses.
     1323         *
     1324         * @since 2.5.0
     1325         *
     1326         * @param array $args Method parameters.
     1327         * @return array
     1328         */
    11481329        function wp_getPostStatusList( $args ) {
    11491330                $this->escape( $args );
    11501331
     
    11661347                return get_post_statuses( );
    11671348        }
    11681349
    1169 
     1350        /**
     1351         * Retrieve page statuses.
     1352         *
     1353         * @since 2.5.0
     1354         *
     1355         * @param array $args Method parameters.
     1356         * @return array
     1357         */
    11701358        function wp_getPageStatusList( $args ) {
    11711359                $this->escape( $args );
    11721360
     
    11881376                return get_page_statuses( );
    11891377        }
    11901378
     1379        /**
     1380         * Retrieve page templates.
     1381         *
     1382         * @since 2.6.0
     1383         *
     1384         * @param array $args Method parameters.
     1385         * @return array
     1386         */
    11911387        function wp_getPageTemplates( $args ) {
    11921388                $this->escape( $args );
    11931389
     
    12101406                return $templates;
    12111407        }
    12121408
     1409        /**
     1410         * Retrieve blog options.
     1411         *
     1412         * @since 2.6.0
     1413         *
     1414         * @param array $args Method parameters.
     1415         * @return array
     1416         */
    12131417        function wp_getOptions( $args ) {
    12141418                $this->escape( $args );
    12151419
     
    12311435                return $this->_getOptions($options);
    12321436        }
    12331437
     1438        /**
     1439         * Retrieve blog options value from list.
     1440         *
     1441         * @since 2.6.0
     1442         *
     1443         * @param array $options Options to retrieve.
     1444         * @return array
     1445         */
    12341446        function _getOptions($options)
    12351447        {
    12361448                $data = array( );
     
    12491461                return $data;
    12501462        }
    12511463
     1464        /**
     1465         * Update blog options.
     1466         *
     1467         * @since 2.6.0
     1468         *
     1469         * @param array $args Method parameters.
     1470         * @return unknown
     1471         */
    12521472        function wp_setOptions( $args ) {
    12531473                $this->escape( $args );
    12541474
     
    12821502                return $this->_getOptions($option_names);
    12831503        }
    12841504
    1285         /* Blogger API functions
     1505        /* Blogger API functions.
    12861506         * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
    12871507         */
    12881508
    1289 
    1290         /* blogger.getUsersBlogs will make more sense once we support multiple blogs */
     1509        /**
     1510         * Retrieve blogs that user owns.
     1511         *
     1512         * Will make more sense once we support multiple blogs.
     1513         *
     1514         * @since 1.5.0
     1515         *
     1516         * @param array $args Method parameters.
     1517         * @return array
     1518         */
    12911519        function blogger_getUsersBlogs($args) {
    12921520
    12931521                $this->escape($args);
     
    13151543                return array($struct);
    13161544        }
    13171545
    1318 
    1319         /* blogger.getUsersInfo gives your client some info about you, so you don't have to */
     1546        /**
     1547         * Retrieve user's data.
     1548         *
     1549         * Gives your client some info about you, so you don't have to.
     1550         *
     1551         * @since 1.5.0
     1552         *
     1553         * @param array $args Method parameters.
     1554         * @return array
     1555         */
    13201556        function blogger_getUserInfo($args) {
    13211557
    13221558                $this->escape($args);
     
    13471583                return $struct;
    13481584        }
    13491585
    1350 
    1351         /* blogger.getPost ...gets a post */
     1586        /**
     1587         * Retrieve post.
     1588         *
     1589         * @since 1.5.0
     1590         *
     1591         * @param array $args Method parameters.
     1592         * @return array
     1593         */
    13521594        function blogger_getPost($args) {
    13531595
    13541596                $this->escape($args);
     
    13851627                return $struct;
    13861628        }
    13871629
    1388 
    1389         /* blogger.getRecentPosts ...gets recent posts */
     1630        /**
     1631         * Retrieve list of recent posts.
     1632         *
     1633         * @since 1.5.0
     1634         *
     1635         * @param array $args Method parameters.
     1636         * @return array
     1637         */
    13901638        function blogger_getRecentPosts($args) {
    13911639
    13921640                $this->escape($args);
     
    14391687                return $recent_posts;
    14401688        }
    14411689
    1442 
    1443         /* blogger.getTemplate returns your blog_filename */
     1690        /**
     1691         * Retrieve blog_filename content.
     1692         *
     1693         * @since 1.5.0
     1694         *
     1695         * @param array $args Method parameters.
     1696         * @return string
     1697         */
    14441698        function blogger_getTemplate($args) {
    14451699
    14461700                $this->escape($args);
    14471701
    1448           $blog_ID    = (int) $args[1];
    1449           $user_login = $args[2];
    1450           $user_pass  = $args[3];
    1451           $template   = $args[4]; /* could be 'main' or 'archiveIndex', but we don't use it */
     1702                $blog_ID    = (int) $args[1];
     1703                $user_login = $args[2];
     1704                $user_pass  = $args[3];
     1705                $template   = $args[4]; /* could be 'main' or 'archiveIndex', but we don't use it */
    14521706
    1453           if (!$this->login_pass_ok($user_login, $user_pass)) {
    1454             return $this->error;
    1455           }
     1707                if (!$this->login_pass_ok($user_login, $user_pass)) {
     1708                        return $this->error;
     1709                }
    14561710
    1457           do_action('xmlrpc_call', 'blogger.getTemplate');
     1711                do_action('xmlrpc_call', 'blogger.getTemplate');
    14581712
    1459           set_current_user(0, $user_login);
    1460           if ( !current_user_can('edit_themes') ) {
    1461             return new IXR_Error(401, __('Sorry, this user can not edit the template.'));
    1462           }
     1713                set_current_user(0, $user_login);
     1714                if ( !current_user_can('edit_themes') ) {
     1715                        return new IXR_Error(401, __('Sorry, this user can not edit the template.'));
     1716                }
    14631717
    1464           /* warning: here we make the assumption that the blog's URL is on the same server */
    1465           $filename = get_option('home') . '/';
    1466           $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
     1718                /* warning: here we make the assumption that the blog's URL is on the same server */
     1719                $filename = get_option('home') . '/';
     1720                $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
    14671721
    1468           $f = fopen($filename, 'r');
    1469           $content = fread($f, filesize($filename));
    1470           fclose($f);
     1722                $f = fopen($filename, 'r');
     1723                $content = fread($f, filesize($filename));
     1724                fclose($f);
    14711725
    1472           /* so it is actually editable with a windows/mac client */
    1473           // FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented.     $content = str_replace("\n", "\r\n", $content);
     1726                /* so it is actually editable with a windows/mac client */
     1727                // FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented.     $content = str_replace("\n", "\r\n", $content);
    14741728
    1475           return $content;
     1729                return $content;
    14761730        }
    14771731
    1478 
    1479         /* blogger.setTemplate updates the content of blog_filename */
     1732        /**
     1733         * Updates the content of blog_filename.
     1734         *
     1735         * @since 1.5.0
     1736         *
     1737         * @param array $args Method parameters.
     1738         * @return bool True when done.
     1739         */
    14801740        function blogger_setTemplate($args) {
    14811741
    14821742                $this->escape($args);
     
    15121772                return true;
    15131773        }
    15141774
    1515 
    1516         /* blogger.newPost ...creates a new post */
     1775        /**
     1776         * Create new post.
     1777         *
     1778         * @since 1.5.0
     1779         *
     1780         * @param array $args Method parameters.
     1781         * @return int
     1782         */
    15171783        function blogger_newPost($args) {
    15181784
    15191785                $this->escape($args);
     
    15621828                return $post_ID;
    15631829        }
    15641830
    1565         /* blogger.editPost ...edits a post */
     1831        /**
     1832         * Edit a post.
     1833         *
     1834         * @since 1.5.0
     1835         *
     1836         * @param array $args Method parameters.
     1837         * @return bool true when done.
     1838         */
    15661839        function blogger_editPost($args) {
    15671840
    15681841                $this->escape($args);
     
    16121885                return true;
    16131886        }
    16141887
    1615 
    1616         /* blogger.deletePost ...deletes a post */
     1888        /**
     1889         * Remove a post.
     1890         *
     1891         * @since 1.5.0
     1892         *
     1893         * @param array $args Method parameters.
     1894         * @return bool True when post is deleted.
     1895         */
    16171896        function blogger_deletePost($args) {
    16181897                $this->escape($args);
    16191898
     
    16471926                return true;
    16481927        }
    16491928
    1650 
    1651 
    16521929        /* MetaWeblog API functions
    16531930         * specs on wherever Dave Winer wants them to be
    16541931         */
    16551932
    1656         /* metaweblog.newPost creates a post */
     1933        /**
     1934         * Create a new post.
     1935         *
     1936         * @since 1.5.0
     1937         *
     1938         * @param array $args Method parameters.
     1939         * @return int
     1940         */
    16571941        function mw_newPost($args) {
    16581942                $this->escape($args);
    16591943
     
    18962180                return strval($post_ID);
    18972181        }
    18982182
     2183        /**
     2184         * Attach upload to a post.
     2185         *
     2186         * @since 2.1.0
     2187         *
     2188         * @param int $post_ID Post ID.
     2189         * @param string $post_content Post Content for attachment.
     2190         */
    18992191        function attach_uploads( $post_ID, $post_content ) {
    19002192                global $wpdb;
    19012193
     
    19102202                }
    19112203        }
    19122204
    1913         /* metaweblog.editPost ...edits a post */
     2205        /**
     2206         * Edit a post.
     2207         *
     2208         * @since 1.5.0
     2209         *
     2210         * @param array $args Method parameters.
     2211         * @return bool True on success.
     2212         */
    19142213        function mw_editPost($args) {
    19152214
    19162215                $this->escape($args);
     
    21642463                return true;
    21652464        }
    21662465
    2167 
    2168         /* metaweblog.getPost ...returns a post */
     2466        /**
     2467         * Retrieve post.
     2468         *
     2469         * @since 1.5.0
     2470         *
     2471         * @param array $args Method parameters.
     2472         * @return array
     2473         */
    21692474        function mw_getPost($args) {
    21702475
    21712476                $this->escape($args);
     
    22502555                }
    22512556        }
    22522557
    2253 
    2254         /* metaweblog.getRecentPosts ...returns recent posts */
     2558        /**
     2559         * Retrieve list of recent posts.
     2560         *
     2561         * @since 1.5.0
     2562         *
     2563         * @param array $args Method parameters.
     2564         * @return array
     2565         */
    22552566        function mw_getRecentPosts($args) {
    22562567
    22572568                $this->escape($args);
     
    23222633                                'title' => $entry['post_title'],
    23232634                                'link' => $link,
    23242635                                'permaLink' => $link,
    2325 // commented out because no other tool seems to use this
    2326 //            'content' => $entry['post_content'],
     2636                                // commented out because no other tool seems to use this
     2637                                // 'content' => $entry['post_content'],
    23272638                                'categories' => $categories,
    23282639                                'mt_excerpt' => $entry['post_excerpt'],
    23292640                                'mt_text_more' => $post['extended'],
     
    23492660                return $recent_posts;
    23502661        }
    23512662
    2352 
    2353         /* metaweblog.getCategories ...returns the list of categories on a given blog */
     2663        /**
     2664         * Retrieve the list of categories on a given blog.
     2665         *
     2666         * @since 1.5.0
     2667         *
     2668         * @param array $args Method parameters.
     2669         * @return array
     2670         */
    23542671        function mw_getCategories($args) {
    23552672
    23562673                $this->escape($args);
     
    23872704                return $categories_struct;
    23882705        }
    23892706
    2390 
    2391         /* metaweblog.newMediaObject uploads a file, following your settings */
     2707        /**
     2708         * Uploads a file, following your settings.
     2709         *
     2710         * Adapted from a patch by Johann Richard.
     2711         *
     2712         * @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
     2713         *
     2714         * @since 1.5.0
     2715         *
     2716         * @param array $args Method parameters.
     2717         * @return array
     2718         */
    23922719        function mw_newMediaObject($args) {
    2393                 // adapted from a patch by Johann Richard
    2394                 // http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
    2395 
    23962720                global $wpdb;
    23972721
    23982722                $blog_ID     = (int) $args[0];
     
    24642788                return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) );
    24652789        }
    24662790
    2467 
    24682791        /* MovableType API functions
    24692792         * specs on http://www.movabletype.org/docs/mtmanual_programmatic.html
    24702793         */
    24712794
    2472         /* mt.getRecentPostTitles ...returns recent posts' titles */
     2795        /**
     2796         * Retrieve the post titles of recent posts.
     2797         *
     2798         * @since 1.5.0
     2799         *
     2800         * @param array $args Method parameters.
     2801         * @return array
     2802         */
    24732803        function mt_getRecentPostTitles($args) {
    24742804
    24752805                $this->escape($args);
     
    25192849                return $recent_posts;
    25202850        }
    25212851
    2522 
    2523         /* mt.getCategoryList ...returns the list of categories on a given blog */
     2852        /**
     2853         * Retrieve list of all categories on blog.
     2854         *
     2855         * @since 1.5.0
     2856         *
     2857         * @param array $args Method parameters.
     2858         * @return array
     2859         */
    25242860        function mt_getCategoryList($args) {
    25252861
    25262862                $this->escape($args);
     
    25532889                return $categories_struct;
    25542890        }
    25552891
    2556 
    2557         /* mt.getPostCategories ...returns a post's categories */
     2892        /**
     2893         * Retrieve post categories.
     2894         *
     2895         * @since 1.5.0
     2896         *
     2897         * @param array $args Method parameters.
     2898         * @return array
     2899         */
    25582900        function mt_getPostCategories($args) {
    25592901
    25602902                $this->escape($args);
     
    25892931                return $categories;
    25902932        }
    25912933
    2592 
    2593         /* mt.setPostCategories ...sets a post's categories */
     2934        /**
     2935         * Sets categories for a post.
     2936         *
     2937         * @since 1.5.0
     2938         *
     2939         * @param array $args Method parameters.
     2940         * @return bool True on success.
     2941         */
    25942942        function mt_setPostCategories($args) {
    25952943
    25962944                $this->escape($args);
     
    26192967                return true;
    26202968        }
    26212969
    2622 
    2623         /* mt.supportedMethods ...returns an array of methods supported by this server */
     2970        /**
     2971         * Retrieve an array of methods supported by this server.
     2972         *
     2973         * @since 1.5.0
     2974         *
     2975         * @param array $args Method parameters.
     2976         * @return array
     2977         */
    26242978        function mt_supportedMethods($args) {
    26252979
    26262980                do_action('xmlrpc_call', 'mt.supportedMethods');
     
    26332987                return $supported_methods;
    26342988        }
    26352989
    2636 
    2637         /* mt.supportedTextFilters ...returns an empty array because we don't
    2638                  support per-post text filters yet */
     2990        /**
     2991         * Retrieve an empty array because we don't support per-post text filters.
     2992         *
     2993         * @since 1.5.0
     2994         *
     2995         * @param array $args Method parameters.
     2996         */
    26392997        function mt_supportedTextFilters($args) {
    26402998                do_action('xmlrpc_call', 'mt.supportedTextFilters');
    26412999                return apply_filters('xmlrpc_text_filters', array());
    26423000        }
    26433001
    2644 
    2645         /* mt.getTrackbackPings ...returns trackbacks sent to a given post */
     3002        /**
     3003         * Retrieve trackbacks sent to a given post.
     3004         *
     3005         * @since 1.5.0
     3006         *
     3007         * @param array $args Method parameters.
     3008         * @return mixed
     3009         */
    26463010        function mt_getTrackbackPings($args) {
    26473011
    26483012                global $wpdb;
     
    26793043                return $trackback_pings;
    26803044        }
    26813045
    2682 
    2683         /* mt.publishPost ...sets a post's publish status to 'publish' */
     3046        /**
     3047         * Sets a post's publish status to 'publish'.
     3048         *
     3049         * @since 1.5.0
     3050         *
     3051         * @param array $args Method parameters.
     3052         * @return int
     3053         */
    26843054        function mt_publishPost($args) {
    26853055
    26863056                $this->escape($args);
     
    27133083                return $result;
    27143084        }
    27153085
    2716 
    2717 
    27183086        /* PingBack functions
    27193087         * specs on www.hixie.ch/specs/pingback/pingback
    27203088         */
    27213089
    2722         /* pingback.ping gets a pingback and registers it */
     3090        /**
     3091         * Retrieves a pingback and registers it.
     3092         *
     3093         * @since 1.5.0
     3094         *
     3095         * @param array $args Method parameters.
     3096         * @return array
     3097         */
    27233098        function pingback_ping($args) {
    27243099                global $wpdb;
    27253100
     
    28813256                return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
    28823257        }
    28833258
    2884 
    2885         /* pingback.extensions.getPingbacks returns an array of URLs
    2886         that pingbacked the given URL
    2887         specs on http://www.aquarionics.com/misc/archives/blogite/0198.html */
     3259        /**
     3260         * Retrieve array of URLs that pingbacked the given URL.
     3261         *
     3262         * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html
     3263         *
     3264         * @since 1.5.0
     3265         *
     3266         * @param array $args Method parameters.
     3267         * @return array
     3268         */
    28883269        function pingback_extensions_getPingbacks($args) {
    28893270
    28903271                global $wpdb;
     
    29243305        }
    29253306}
    29263307
    2927 
    29283308$wp_xmlrpc_server = new wp_xmlrpc_server();
    29293309
    29303310?>