Make WordPress Core


Ignore:
Timestamp:
10/26/2019 09:07:10 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Switch more docs over to typed array notation, plus some fixes.

See #48303, #41756

File:
1 edited

Legend:

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

    r46594 r46596  
    863863     * @since 4.4.0
    864864     *
    865      * @param array $post_links An array of enclosure links.
    866      * @param int   $post_ID    Post ID.
     865     * @param string[] $post_links An array of enclosure links.
     866     * @param int      $post_ID    Post ID.
    867867     */
    868868    $post_links = apply_filters( 'enclosure_links', $post_links, $post->ID );
     
    11481148 * @since 4.4.0
    11491149 *
    1150  * @return array An array of parameters to remove from the URL.
     1150 * @return string[] An array of parameters to remove from the URL.
    11511151 */
    11521152function wp_removable_query_args() {
     
    11821182     * @since 4.2.0
    11831183     *
    1184      * @param array $removable_query_args An array of query variables to remove from a URL.
     1184     * @param string[] $removable_query_args An array of query variables to remove from a URL.
    11851185     */
    11861186    return apply_filters( 'removable_query_args', $removable_query_args );
     
    26142614 * @since 2.0.4
    26152615 *
    2616  * @param string $filename File name or path.
    2617  * @param array  $mimes    Optional. Key is the file extension with value as the mime type.
    2618  * @return array Values with extension first and mime type.
     2616 * @param string   $filename File name or path.
     2617 * @param string[] $mimes    Optional. Array of mime types keyed by their file extension regex.
     2618 * @return array {
     2619 *     Values with extension first and mime type.
     2620 *
     2621 *     @type string $0 File extension.
     2622 *     @type string $1 File mime type.
     2623 * }
    26192624 */
    26202625function wp_check_filetype( $filename, $mimes = null ) {
     
    26492654 * @since 3.0.0
    26502655 *
    2651  * @param string $file     Full path to the file.
    2652  * @param string $filename The name of the file (may differ from $file due to $file being
    2653  *                         in a tmp directory).
    2654  * @param array   $mimes   Optional. Key is the file extension with value as the mime type.
     2656 * @param string   $file     Full path to the file.
     2657 * @param string   $filename The name of the file (may differ from $file due to $file being
     2658 *                           in a tmp directory).
     2659 * @param string[] $mimes    Optional. Array of mime types keyed by their file extension regex.
    26552660 * @return array Values for the extension, MIME, and either a corrected filename or false
    26562661 *               if original $filename is valid.
     
    28152820     * @param string      $filename                  The name of the file (may differ from $file due to
    28162821     *                                               $file being in a tmp directory).
    2817      * @param array       $mimes                     Key is the file extension with value as the mime type.
     2822     * @param string[]    $mimes                     Array of mime types keyed by their file extension regex.
    28182823     * @param string|bool $real_mime                 The actual mime type or false if the type cannot be determined.
    28192824     */
     
    28622867 * @since 4.9.6 Support was added for AAC (.aac) files.
    28632868 *
    2864  * @return array Array of mime types keyed by the file extension regex corresponding to those types.
     2869 * @return string[] Array of mime types keyed by the file extension regex corresponding to those types.
    28652870 */
    28662871function wp_get_mime_types() {
     
    28732878     * @since 3.5.0
    28742879     *
    2875      * @param array $wp_get_mime_types Mime types keyed by the file extension regex
     2880     * @param string[] $wp_get_mime_types Mime types keyed by the file extension regex
    28762881     *                                 corresponding to those types.
    28772882     */
     
    30253030 *
    30263031 * @param int|WP_User $user Optional. User to check. Defaults to current user.
    3027  * @return array Array of mime types keyed by the file extension regex corresponding
    3028  *               to those types.
     3032 * @return string[] Array of mime types keyed by the file extension regex corresponding
     3033 *                  to those types.
    30293034 */
    30303035function get_allowed_mime_types( $user = null ) {
     
    41554160     * @since 4.7.0
    41564161     *
    4157      * @param array $wpsmiliestrans List of the smilies.
     4162     * @param string[] $wpsmiliestrans List of the smilies' hexadecimal representations, keyed by their smily code.
    41584163     */
    41594164    $wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans );
     
    50115016 * @since 1.2.0
    50125017 *
    5013  * @param string $file          File path.
    5014  * @param array  $allowed_files Optional. List of allowed files.
     5018 * @param string   $file          File path.
     5019 * @param string[] $allowed_files Optional. Array of allowed files.
    50155020 * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
    50165021 */
     
    59795984         * @since 3.0.0
    59805985         *
    5981          * @param array $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
     5986         * @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
    59825987         */
    59835988        $protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );
Note: See TracChangeset for help on using the changeset viewer.