WordPress.org

Make WordPress Core

Ticket #15238: wp-xmlrpcdoc-15238-wip-2.patch

File wp-xmlrpcdoc-15238-wip-2.patch, 2.7 KB (added by koke, 7 years ago)

More documentation for wp.getComments, wp.deleteComment, and wp.editComment

  • wp-includes/class-wp-xmlrpc-server.php

     
    10201020        /**
    10211021         * Retrieve comments.
    10221022         *
     1023         * Besides the common blog_id, username, and password arguments, it takes a filter
     1024         * array as last argument.
     1025         *
     1026         * Accepted 'filter' keys are 'status', 'post_id', 'offset', and 'number'.
     1027         *
     1028         * The defaults are as follows:
     1029         * - 'status' - Default is ''. Filter by status (e.g., 'approve', 'hold')
     1030         * - 'post_id' - Default is ''. The post where the comment is posted. Empty string shows all comments.
     1031         * - 'number' - Default is 10. Total number of media items to retrieve.
     1032         * - 'offset' - Default is 0. See {@link WP_Query::query()} for more.
     1033         *
    10231034         * @since 2.7.0
    10241035         *
    10251036         * @param array $args Method parameters.
    1026          * @return array
     1037         * @return array. Contains a collection of comments. See {@link wp_xmlrpc_server::wp_getComment()} for a description of each item contents
    10271038         */
    10281039        function wp_getComments($args) {
    10291040                $raw_args = $args;
     
    10671078
    10681079                $comments_struct = array();
    10691080
     1081    // FIXME: we already have the comments, why query them again?
    10701082                for ( $i = 0; $i < $num_comments; $i++ ) {
    10711083                        $comment = wp_xmlrpc_server::wp_getComment(array(
    10721084                                $raw_args[0], $raw_args[1], $raw_args[2], $comments[$i]->comment_ID,
     
    10781090        }
    10791091
    10801092        /**
    1081          * Remove comment.
     1093         * Delete a comment.
    10821094         *
     1095         * By default, the comment will be moved to the trash instead of deleted.
     1096         * See {@link wp_delete_comment()} for more information on
     1097         * this behavior.
     1098         *
    10831099         * @since 2.7.0
    10841100         *
    1085          * @param array $args Method parameters.
     1101         * @param array $args Method parameters. Contains:
     1102         *  - blog_id
     1103         *  - username
     1104         *  - password
     1105         *  - comment_id
    10861106         * @return mixed {@link wp_delete_comment()}
    10871107         */
    10881108        function wp_deleteComment($args) {
     
    11131133        /**
    11141134         * Edit comment.
    11151135         *
     1136         * Besides the common blog_id, username, and password arguments, it takes a
     1137         * comment_id integer and a content_struct array as last argument.
     1138         *
     1139         * The allowed keys in the content_struct array are:
     1140         *  - 'author'
     1141         *  - 'author_url'
     1142         *  - 'author_email'
     1143         *  - 'content'
     1144         *  - 'date_created_gmt'
     1145         *  - 'status'. Common statuses are 'approve', 'hold', 'spam'. See {@link get_comment_statuses()} for more details
     1146         *
    11161147         * @since 2.7.0
    11171148         *
    1118          * @param array $args Method parameters.
     1149         * @param array $args. Contains:
     1150         *  - blog_id
     1151         *  - username
     1152         *  - password
     1153         *  - comment_id
     1154         *  - content_struct
    11191155         * @return bool True, on success.
    11201156         */
    11211157        function wp_editComment($args) {