Make WordPress Core


Ignore:
Timestamp:
03/12/2023 02:48:03 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve some DocBlock formatting in wp-includes/class-wp-xmlrpc-server.php.

Includes clarifying the list of fields passed to the xmlrpc_default_*_fields filters by default.

Follow-up to [16046], [17647], [27730], [32550], [37492], [55316].

See #57840.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r55365 r55539  
    199199                 *
    200200                 * Contrary to the way it's named, this filter does not control whether XML-RPC is *fully*
    201                  * enabled, rather, it only controls whether XML-RPC methods requiring authentication - such
    202                  * as for publishing purposes - are enabled.
     201                 * enabled, rather, it only controls whether XML-RPC methods requiring authentication -
     202                 * such as for publishing purposes - are enabled.
    203203                 *
    204204                 * Further, the filter does not control whether pingbacks or other custom endpoints that don't
    … …  
    19101910                } else {
    19111911                        /**
    1912                          * Filters the list of post query fields used by the given XML-RPC method.
     1912                         * Filters the default post query fields used by the given XML-RPC method.
    19131913                         *
    19141914                         * @since 3.4.0
    19151915                         *
    1916                          * @param array  $fields Array of post fields. Default array contains 'post', 'terms', and 'custom_fields'.
     1916                         * @param array  $fields An array of post fields to retrieve. By default,
     1917                         *                       contains 'post', 'terms', and 'custom_fields'.
    19171918                         * @param string $method Method name.
    19181919                         */
    … …  
    19611962         *     @type array  $4 Optional. The subset of post type fields to return in the response array.
    19621963         * }
    1963          * @return array|IXR_Error Array contains a collection of posts.
     1964         * @return array|IXR_Error Array containing a collection of posts.
    19641965         */
    19651966        public function wp_getPosts( $args ) {
    … …  
    25412542                } else {
    25422543                        /**
    2543                          * Filters the taxonomy query fields used by the given XML-RPC method.
     2544                         * Filters the default taxonomy query fields used by the given XML-RPC method.
    25442545                         *
    25452546                         * @since 3.4.0
    25462547                         *
    2547                          * @param array  $fields An array of taxonomy fields to retrieve.
     2548                         * @param array  $fields An array of taxonomy fields to retrieve. By default,
     2549                         *                       contains 'labels', 'cap', and 'object_type'.
    25482550                         * @param string $method The method name.
    25492551                         */
    … …  
    26892691                         * @since 3.5.0
    26902692                         *
    2691                          * @param array  $fields User query fields for given method. Default 'all'.
     2693                         * @param array  $fields An array of user fields to retrieve. By default, contains 'all'.
    26922694                         * @param string $method The method name.
    26932695                         */
    … …  
    36063608         * Retrieves comments.
    36073609         *
    3608          * Besides the common blog_id (unused), username, and password arguments, it takes a filter
    3609          * array as last argument.
     3610         * Besides the common blog_id (unused), username, and password arguments,
     3611         * it takes a filter array as the last argument.
    36103612         *
    36113613         * Accepted 'filter' keys are 'status', 'post_id', 'offset', and 'number'.
    36123614         *
    36133615         * The defaults are as follows:
    3614          * - 'status' - Default is ''. Filter by status (e.g., 'approve', 'hold')
    3615          * - 'post_id' - Default is ''. The post where the comment is posted. Empty string shows all comments.
    3616          * - 'number' - Default is 10. Total number of media items to retrieve.
    3617          * - 'offset' - Default is 0. See WP_Query::query() for more.
     3616         * - 'status'  - Default is ''. Filter by status (e.g., 'approve', 'hold')
     3617         * - 'post_id' - Default is ''. The post where the comment is posted.
     3618         *               Empty string shows all comments.
     3619         * - 'number'  - Default is 10. Total number of media items to retrieve.
     3620         * - 'offset'  - Default is 0. See WP_Query::query() for more.
    36183621         *
    36193622         * @since 2.7.0
    … …  
    36273630         *     @type array  $3 Optional. Query arguments.
    36283631         * }
    3629          * @return array|IXR_Error Contains a collection of comments. See wp_xmlrpc_server::wp_getComment()
    3630          *                         for a description of each item contents.
     3632         * @return array|IXR_Error Array containing a collection of comments.
     3633         *                         See wp_xmlrpc_server::wp_getComment() for a description
     3634         *                         of each item contents.
    36313635         */
    36323636        public function wp_getComments( $args ) {
    … …  
    37603764         * Edits a comment.
    37613765         *
    3762          * Besides the common blog_id (unused), username, and password arguments, it takes a
    3763          * comment_id integer and a content_struct array as last argument.
     3766         * Besides the common blog_id (unused), username, and password arguments,
     3767         * it takes a comment_id integer and a content_struct array as the last argument.
    37643768         *
    37653769         * The allowed keys in the content_struct array are:
    … …  
    43784382         * Retrieves a collection of media library items (or attachments).
    43794383         *
    4380          * Besides the common blog_id (unused), username, and password arguments, it takes a filter
    4381          * array as last argument.
     4384         * Besides the common blog_id (unused), username, and password arguments,
     4385         * it takes a filter array as the last argument.
    43824386         *
    43834387         * Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.
    43844388         *
    43854389         * The defaults are as follows:
    4386          * - 'number' - Default is 5. Total number of media items to retrieve.
    4387          * - 'offset' - Default is 0. See WP_Query::query() for more.
    4388          * - 'parent_id' - Default is ''. The post where the media item is attached. Empty string shows all media items. 0 shows unattached media items.
     4390         * - 'number'    - Default is 5. Total number of media items to retrieve.
     4391         * - 'offset'    - Default is 0. See WP_Query::query() for more.
     4392         * - 'parent_id' - Default is ''. The post where the media item is attached.
     4393         *                 Empty string shows all media items. 0 shows unattached media items.
    43894394         * - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')
    43904395         *
    … …  
    43974402         *     @type string $1 Username.
    43984403         *     @type string $2 Password.
    4399          *     @type array  $3 Query arguments.
     4404         *     @type array  $3 Optional. Query arguments.
    44004405         * }
    4401          * @return array|IXR_Error Contains a collection of media items.
    4402          *                   See wp_xmlrpc_server::wp_getMediaItem() for
    4403          *                   a description of each item contents.
     4406         * @return array|IXR_Error Array containing a collection of media items.
     4407         *                         See wp_xmlrpc_server::wp_getMediaItem() for a description
     4408         *                         of each item contents.
    44044409         */
    44054410        public function wp_getMediaLibrary( $args ) {
    … …  
    45404545                } else {
    45414546                        /**
    4542                          * Filters the default query fields used by the given XML-RPC method.
     4547                         * Filters the default post type query fields used by the given XML-RPC method.
    45434548                         *
    45444549                         * @since 3.4.0
    45454550                         *
    4546                          * @param array  $fields An array of post type query fields for the given method.
     4551                         * @param array  $fields An array of post type fields to retrieve. By default,
     4552                         *                       contains 'labels', 'cap', and 'taxonomies'.
    45474553                         * @param string $method The method name.
    45484554                         */
    … …  
    46504656         *     @type array  $4 Optional. Fields to fetch.
    46514657         * }
    4652          * @return array|IXR_Error contains a collection of posts.
     4658         * @return array|IXR_Error Array containing a collection of posts.
    46534659         */
    46544660        public function wp_getRevisions( $args ) {
    … …  
    46714677                         * @since 3.5.0
    46724678                         *
    4673                          * @param array  $field  An array of revision query fields.
     4679                         * @param array  $field  An array of revision fields to retrieve. By default,
     4680                         *                       contains 'post_date' and 'post_date_gmt'.
    46744681                         * @param string $method The method name.
    46754682                         */
Note: See TracChangeset for help on using the changeset viewer.