Make WordPress Core

Changeset 16046


Ignore:
Timestamp:
10/28/2010 12:12:59 PM (14 years ago)
Author:
westi
Message:

phpDoc and a bug fix for the new media XMLRPC functions. See #15151 props koke.

File:
1 edited

Legend:

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

    r16016 r16046  
    14851485
    14861486    /**
    1487      * Retrieve media item.
     1487     * Retrieve a media item by ID
    14881488     *
    14891489     * @since 3.1.0
    1490      * @todo Docment this!
    1491      *
    1492      * @param array $args Method parameters.
    1493      * @return array
     1490     *
     1491     * @param array $args Method parameters. Contains:
     1492     *  - blog_id
     1493     *  - username
     1494     *  - password
     1495     *  - attachment_id
     1496     * @return array. Assocciative array containing:
     1497     *  - 'date_created_gmt'
     1498     *  - 'parent'
     1499     *  - 'link'
     1500     *  - 'thumbnail'
     1501     *  - 'title'
     1502     *  - 'caption'
     1503     *  - 'description'
     1504     *  - 'metadata'
    14941505     */
    14951506    function wp_getMediaItem($args) {
     
    15341545
    15351546    /**
    1536      * Retrieve media library items.
    1537      *
     1547     * Retrieves a collection of media library items (or attachments)
     1548     *
     1549     * Besides the common blog_id, username, and password arguments, it takes a filter
     1550     * array as last argument.
     1551     *
     1552     * Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.
     1553     *
     1554     * The defaults are as follows:
     1555     * - 'number' - Default is 5. Total number of media items to retrieve.
     1556     * - 'offset' - Default is 0. See {@link WP_Query::query()} for more.
     1557     * - 'parent_id' - Default is ''. The post where the media item is attached. Empty string shows all media items. 0 shows unattached media items.
     1558     * - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')
     1559     *
    15381560     * @since 3.1.0
    1539      * @todo Document this.
    1540      *
    1541      * @param array $args Method parameters.
    1542      * @return array
     1561     *
     1562     * @param array $args Method parameters. Contains:
     1563     *  - blog_id
     1564     *  - username
     1565     *  - password
     1566     *  - filter
     1567     * @return array. Contains a collection of media items. See {@link wp_xmlrpc_server::wp_getMediaItem()} for a description of each item contents
    15431568     */
    15441569    function wp_getMediaLibrary($args) {
     
    15591584        do_action('xmlrpc_call', 'wp.getMediaLibrary');
    15601585
    1561         $parent_id = ( isset($struct['parent_id']) ) ? absint($struct['parent_id']) : 0 ;
    1562         $mime_type = ( isset($struct['mime_type']) ) ? absint($struct['mime_type']) : '' ;     
     1586        $parent_id = ( isset($struct['parent_id']) ) ? absint($struct['parent_id']) : '' ;
     1587        $mime_type = ( isset($struct['mime_type']) ) ? $struct['mime_type'] : '' ;
    15631588        $offset = ( isset($struct['offset']) ) ? absint($struct['offset']) : 0 ;
    15641589        $number = ( isset($struct['number']) ) ? absint($struct['number']) : -1 ;
Note: See TracChangeset for help on using the changeset viewer.