WordPress.org

Make WordPress Core

Changeset 30681


Ignore:
Timestamp:
12/01/2014 01:33:34 AM (7 years ago)
Author:
wonderboymusic
Message:

Improve various @param docs for src/wp-includes/*.

See #30224.

Location:
trunk/src/wp-includes
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/bookmark.php

    r30122 r30681  
    1414 * @global wpdb $wpdb WordPress database abstraction object.
    1515 *
    16  * @param mixed $bookmark
     16 * @param int|stdClass $bookmark
    1717 * @param string $output Optional. Either OBJECT, ARRAY_N, or ARRAY_A constant
    1818 * @param string $filter Optional, default is 'raw'.
  • trunk/src/wp-includes/cache.php

    r29454 r30681  
    665665     *
    666666     * @access protected
     667     * @param string $key
     668     * @param string $group
     669     * @return bool
    667670     */
    668671    protected function _exists( $key, $group ) {
  • trunk/src/wp-includes/canonical.php

    r30122 r30681  
    493493 * @access private
    494494 *
     495 * @param string $query_string
     496 * @param array $args_to_check
     497 * @param string $url
    495498 * @return string The altered query string
    496499 */
  • trunk/src/wp-includes/capabilities.php

    r30656 r30681  
    612612     *
    613613     * @since 3.3.0
     614     * @param string $key
     615     * @return bool
    614616     */
    615617    public function __isset( $key ) {
     
    632634     *
    633635     * @since 3.3.0
     636     * @param string $key
     637     * @return mixed
    634638     */
    635639    public function __get( $key ) {
  • trunk/src/wp-includes/category-template.php

    r30656 r30681  
    459459 *
    460460 * @param string|array $args Optional. Override default arguments.
    461  * @return string HTML content only if 'echo' argument is 0.
     461 * @return false|null|string HTML content only if 'echo' argument is 0.
    462462 */
    463463function wp_list_categories( $args = '' ) {
     
    587587 * @since 2.3.0
    588588 *
    589  * @param array|string $args Optional. Override default arguments.
    590  * @return array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument.
     589 * @param array|string|null $args Optional. Override default arguments.
     590 * @return null|false Generated tag cloud, only if no failures and 'array' is set for the 'format' argument.
    591591 */
    592592function wp_tag_cloud( $args = '' ) {
     
    13221322 * @param string $sep Optional. Separate items using this.
    13231323 * @param string $after Optional. After list.
    1324  * @return null|bool False on WordPress error. Returns null when displaying.
     1324 * @return false|null False on WordPress error. Returns null when displaying.
    13251325 */
    13261326function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
  • trunk/src/wp-includes/class-http.php

    r30604 r30681  
    300300     * @param string $url URL to Request
    301301     *
    302      * @return string|bool Class name for the first transport that claims to support the request. False if no transport claims to support the request.
     302     * @return string|false Class name for the first transport that claims to support the request. False if no transport claims to support the request.
    303303     */
    304304    public function _get_first_available_transport( $args, $url = null ) {
     
    20812081     * @param int $level Optional, default is 9. Compression level, 9 is highest.
    20822082     * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports.
    2083      * @return string|bool False on failure.
     2083     * @return string|false False on failure.
    20842084     */
    20852085    public static function compress( $raw, $level = 9, $supports = null ) {
     
    21812181     * @since 2.8.0
    21822182     *
     2183     * @param string $url
     2184     * @param array  $args
    21832185     * @return string Types of encoding to accept.
    21842186     */
  • trunk/src/wp-includes/class-oembed.php

    r30536 r30681  
    271271     * @param string $url The URL to the content that should be attempted to be embedded.
    272272     * @param array $args Optional arguments. Usually passed from a shortcode.
    273      * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
     273     * @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
    274274     */
    275275    function get_html( $url, $args = '' ) {
     
    497497     * @param object $data A data object result from an oEmbed provider.
    498498     * @param string $url The URL to the content that is desired to be embedded.
    499      * @return bool|string False on error, otherwise the HTML needed to embed.
     499     * @return false|string False on error, otherwise the HTML needed to embed.
    500500     */
    501501    public function data2html( $data, $url ) {
  • trunk/src/wp-includes/class-wp-editor.php

    r30670 r30681  
    251251    }
    252252
     253    /**
     254     * @param string $editor_id
     255     * @param array  $set
     256     */
    253257    public static function editor_settings($editor_id, $set) {
    254258        $first_run = false;
     
    757761     * @param string $mce_locale The locale used for the editor.
    758762     * @param bool $json_only optional Whether to include the Javascript calls to tinymce.addI18n() and tinymce.ScriptLoader.markDone().
    759      * @return The translation object, JSON encoded.
     763     * @return string Translation object, JSON encoded.
    760764     */
    761765    public static function wp_mce_translation( $mce_locale = '', $json_only = false ) {
     
    13291333     *
    13301334     * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.
    1331      * @return array Results.
     1335     * @return false|array Results.
    13321336     */
    13331337    public static function wp_link_query( $args = array() ) {
  • trunk/src/wp-includes/class-wp-embed.php

    r30537 r30681  
    335335     *
    336336     * @param string $url URL to potentially be linked.
    337      * @return string|bool Linked URL or the original URL. False if 'return_false_on_fail' is true.
     337     * @return false|string Linked URL or the original URL. False if 'return_false_on_fail' is true.
    338338     */
    339339    public function maybe_make_link( $url ) {
  • trunk/src/wp-includes/class-wp-error.php

    r29854 r30681  
    243243        $this->error_data[$code] = $data;
    244244    }
    245    
     245
    246246    /**
    247247     * Removes the specified error.
  • trunk/src/wp-includes/class-wp-http-ixr-client.php

    r30179 r30681  
    1414    public $error;
    1515
     16    /**
     17     * @param string $server
     18     * @param string|bool $path
     19     * @param int|bool $port
     20     * @param int $timeout
     21     */
    1622    public function __construct($server, $path = false, $port = false, $timeout = 15) {
    1723        if ( ! $path ) {
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r30180 r30681  
    256256     * @access public
    257257     *
    258      * @param string|int $src The source file or Attachment ID.
    259258     * @param int $src_x The start x position to crop from.
    260259     * @param int $src_y The start y position to crop from.
     
    356355     * @access public
    357356     *
    358      * @param string $destfilename
    359      * @param string $mime_type
     357     * @param string|null $filename
     358     * @param string|null $mime_type
    360359     * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}
    361360     */
     
    371370    }
    372371
     372    /**
     373     * @param resource $image
     374     * @param string|null $filename
     375     * @param string|null $mime_type
     376     * @return WP_Error|array
     377     */
    373378    protected function _save( $image, $filename = null, $mime_type = null ) {
    374379        list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );
  • trunk/src/wp-includes/class-wp-theme.php

    r30105 r30681  
    10341034     * @access public
    10351035     *
    1036      * @return True if the textdomain was successfully loaded or has already been loaded. False if
     1036     * @return bool If the textdomain was successfully loaded or has already been loaded. False if
    10371037     *  no textdomain was specified in the file headers, or if the domain could not be loaded.
    10381038     */
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r30181 r30681  
    46314631    }
    46324632
     4633    /**
     4634     * @param integer $post_ID
     4635     * @param array   $enclosure
     4636     */
    46334637    public function add_enclosure_if_new( $post_ID, $enclosure ) {
    46344638        if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
     
    59155919    }
    59165920
     5921    /**
     5922     * @param integer $code
     5923     * @param string $message
     5924     */
    59175925    protected function pingback_error( $code, $message ) {
    59185926        /**
  • trunk/src/wp-includes/class.wp-styles.php

    r29958 r30681  
    4040    }
    4141
     42    /**
     43     * @param string $handle
     44     * @return bool
     45     */
    4246    public function do_item( $handle ) {
    4347        if ( !parent::do_item($handle) )
     
    120124    }
    121125
     126    /**
     127     * @param string $handle
     128     * @param string $code
     129     */
    122130    public function add_inline_style( $handle, $code ) {
    123131        if ( ! $code ) {
     
    135143    }
    136144
     145    /**
     146     * @param string $handle
     147     * @param bool $echo
     148     * @return bool
     149     */
    137150    public function print_inline_style( $handle, $echo = true ) {
    138151        $output = $this->get_data( $handle, 'after' );
     
    153166    }
    154167
     168    /**
     169     * @param mixed $handles
     170     * @param bool $recursion
     171     * @param mixed $group
     172     * @return bool
     173     */
    155174    public function all_deps( $handles, $recursion = false, $group = false ) {
    156175        $r = parent::all_deps( $handles, $recursion );
     
    168187    }
    169188
     189    /**
     190     * @param string $src
     191     * @param string $ver
     192     * @param string $handle
     193     * @return string
     194     */
    170195    public function _css_href( $src, $ver, $handle ) {
    171196        if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
     
    188213    }
    189214
     215    /**
     216     * @param string $src
     217     * @return bool
     218     */
    190219    public function in_default_dir($src) {
    191220        if ( ! $this->default_dirs )
  • trunk/src/wp-includes/comment-template.php

    r30656 r30681  
    708708 *
    709709 * @param string $deprecated   Not Used.
    710  * @param bool  $deprecated_2 Not Used.
     710 * @param string $deprecated_2 Not Used.
    711711 */
    712712function comments_link( $deprecated = '', $deprecated_2 = '' ) {
     
    13541354 * @param int|WP_Post $post    Post ID or WP_Post object the comment is going to be displayed on.
    13551355 *                             Default current post.
    1356  * @return mixed Link to show comment form, if successful. False, if comments are closed.
     1356 * @return null|false|string Link to show comment form, if successful. False, if comments are closed.
    13571357 */
    13581358function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
     
    14671467 * @param int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
    14681468 *                             Default current post.
    1469  * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
     1469 * @return false|null|string Link to show comment form, if successful. False, if comments are closed.
    14701470 */
    14711471function get_post_reply_link($args = array(), $post = null) {
  • trunk/src/wp-includes/comment.php

    r30656 r30681  
    17461746 *
    17471747 * @param int $comment_id Comment ID
    1748  * @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
     1748 * @return false|string Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
    17491749 */
    17501750function wp_get_comment_status($comment_id) {
     
    22992299 * @param int $post_id Post ID
    23002300 * @param bool $do_deferred Whether to process previously deferred post comment counts
    2301  * @return bool True on success, false on failure
     2301 * @return bool|null True on success, false on failure
    23022302 */
    23032303function wp_update_comment_count($post_id, $do_deferred=false) {
     
    23772377 * @param string $url URL to ping.
    23782378 * @param int $deprecated Not Used.
    2379  * @return bool|string False on failure, string containing URI on success.
     2379 * @return false|string False on failure, string containing URI on success.
    23802380 */
    23812381function discover_pingback_server_uri( $url, $deprecated = '' ) {
  • trunk/src/wp-includes/cron.php

    r30537 r30681  
    6767 * @param string $hook Action hook to execute when cron is run.
    6868 * @param array $args Optional. Arguments to pass to the hook's callback function.
    69  * @return bool|null False on failure, null when complete with scheduling event.
     69 * @return false|null False on failure, null when complete with scheduling event.
    7070 */
    7171function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
     
    100100 * @param string $hook Action hook to execute when cron is run.
    101101 * @param array $args Optional. Arguments to pass to the hook's callback function.
    102  * @return bool|null False on failure. Null when event is rescheduled.
     102 * @return false|null False on failure. Null when event is rescheduled.
    103103 */
    104104function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
  • trunk/src/wp-includes/date.php

    r30612 r30681  
    186186     * @access public
    187187     *
    188      * @param array $query A tax_query query clause.
     188     * @param array $queries
     189     * @param array $parent_query
     190     *
    189191     * @return array Sanitized queries.
    190192     */
     
    778780     * @param string $compare The compare operator to use
    779781     * @param string|array $value The value
    780      * @return string|int|false The value to be used in SQL or false on error.
     782     * @return string|false|int The value to be used in SQL or false on error.
    781783     */
    782784    public function build_value( $compare, $value ) {
  • trunk/src/wp-includes/deprecated.php

    r30538 r30681  
    428428 * @param string $category The category to use.
    429429 * @param string $args
    430  * @return bool|null
     430 * @return string|null
    431431 */
    432432function wp_get_linksbyname($category, $args = '') {
     
    579579 *      order which will return links in a random order.
    580580 * @param bool $show_description Whether to show the description if show_images=false/not defined.
    581  * @param string $limit Limit to X entries. If not specified, all entries are shown.
     581 * @param int $limit Limit to X entries. If not specified, all entries are shown.
    582582 * @param int $show_updated Whether to show last updated timestamp
    583583 */
     
    628628 * @param string $exclude
    629629 * @param bool $hierarchical
    630  * @return string
     630 * @return false|null
    631631 */
    632632function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
     
    647647 *
    648648 * @param string|array $args
    649  * @return string
     649 * @return false|null|string
    650650 */
    651651function wp_list_cats($args = '') {
     
    11571157 * @param bool $echo
    11581158 * @param int $cat_ID
    1159  * @return string|null
     1159 * @return string
    11601160 */
    11611161function get_category_rss_link($echo = false, $cat_ID = 1) {
     
    11791179 * @param bool $echo
    11801180 * @param int $author_id
    1181  * @return string|null
     1181 * @return string
    11821182 */
    11831183function get_author_rss_link($echo = false, $author_id = 1) {
     
    16581658 * @see get_the_author_meta()
    16591659 *
    1660  * @return int The author's ID.
     1660 * @return string|int The author's ID.
    16611661 */
    16621662function get_the_author_ID() {
     
    17021702 *
    17031703 * @param string $more_link_text Optional. Text to display when more content is available but not displayed.
    1704  * @param int|bool $stripteaser Optional. Default is 0.
     1704 * @param int $stripteaser Optional. Default is 0.
    17051705 * @param string $more_file Optional.
    17061706 * @param int $cut Optional. Amount of words to keep for the content.
     
    19611961 * @param bool $fullsize Optional, default to false. Whether to have full size image.
    19621962 * @param array $max_dims Optional. Dimensions of image.
    1963  * @return string HTML content.
     1963 * @return false|string HTML content.
    19641964 */
    19651965function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
     
    20182018 * @param bool $fullsize Optional, default to false. Whether to have full size image.
    20192019 * @param array $max_dims Optional. Dimensions of image.
    2020  * @return string
     2020 * @return false|string
    20212021 */
    20222022function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
     
    30423042 * @see remove_theme_support()
    30433043 *
    3044  * @return bool Whether support was removed.
     3044 * @return null|bool Whether support was removed.
    30453045 */
    30463046function remove_custom_image_header() {
     
    30793079 * @see add_custom_background()
    30803080 *
    3081  * @return bool Whether support was removed.
     3081 * @return null|bool Whether support was removed.
    30823082 */
    30833083function remove_custom_background() {
     
    32933293 * @param int $postid Post ID.
    32943294 * @param string $mode How to return result, either OBJECT, ARRAY_N, or ARRAY_A.
    3295  * @return object|array Post object or array holding post contents and information
     3295 * @return WP_Post|null Post object or array holding post contents and information
    32963296 */
    32973297function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
  • trunk/src/wp-includes/feed.php

    r30105 r30681  
    277277 *
    278278 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
    279  * @return bool|string false on failure or guid for comment on success.
     279 * @return false|string false on failure or guid for comment on success.
    280280 */
    281281function get_comment_guid($comment_id = null) {
  • trunk/src/wp-includes/formatting.php

    r30575 r30681  
    578578 *
    579579 * @param string $string The text which is to be encoded.
    580  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
     580 * @param int $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
    581581 * @param string $charset Optional. The character encoding of the string. Default is false.
    582582 * @param boolean $double_encode Optional. Whether to encode existing html entities. Default is false.
     
    13181318 *
    13191319 * @param string $orderby Order by string to be checked.
    1320  * @return string|bool Returns the order by clause if it is a match, false otherwise.
     1320 * @return false|string Returns the order by clause if it is a match, false otherwise.
    13211321 */
    13221322function sanitize_sql_orderby( $orderby ){
     
    22202220 *
    22212221 * @param array $match The preg_replace_callback matches array
    2222  * @return array Converted chars
     2222 * @return string Converted chars
    22232223 */
    22242224function _wp_iso_convert( $match ) {
Note: See TracChangeset for help on using the changeset viewer.