Make WordPress Core


Ignore:
Timestamp:
02/09/2018 05:25:22 PM (7 years ago)
Author:
johnbillion
Message:

Docs: First pass at switching some array parameter documentation to typed notation.

Props janak007

See #41756

File:
1 edited

Legend:

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

    r42678 r42679  
    123123 * @since 4.9.0 Added the `$exclusions` parameter.
    124124 *
    125  * @param string $folder Optional. Full path to folder. Default empty.
    126  * @param int    $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
    127  * @param array $exclusions Optional. List of folders and files to skip.
    128  * @return bool|array False on failure, Else array of files
     125 * @param string   $folder    Optional. Full path to folder. Default empty.
     126 * @param int      $levels    Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
     127 * @param string[] $exclusions Optional. List of folders and files to skip.
     128 * @return bool|string[] False on failure, else array of files.
    129129 */
    130130function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
     
    176176 * @since 4.9.0
    177177 *
    178  * @param string $plugin Plugin.
    179  * @return array File extensions.
     178 * @param string $plugin Path to the main plugin file from plugins directory.
     179 * @return string[] Array of editable file extensions.
    180180 */
    181181function wp_get_plugin_file_editable_extensions( $plugin ) {
     
    222222     * @since 4.9.0 Added the `$plugin` parameter.
    223223     *
    224      * @param string $plugin Plugin file.
    225      * @param array $editable_extensions An array of editable plugin file extensions.
     224     * @param string[] $editable_extensions An array of editable plugin file extensions.
     225     * @param string   $plugin              Path to the main plugin file from plugins directory.
    226226     */
    227227    $editable_extensions = (array) apply_filters( 'editable_extensions', $editable_extensions, $plugin );
     
    233233 * Get list of file extensions that are editable for a given theme.
    234234 *
    235  * @param WP_Theme $theme Theme.
    236  * @return array File extensions.
     235 * @param WP_Theme $theme Theme object.
     236 * @return string[] Array of editable file extensions.
    237237 */
    238238function wp_get_theme_file_editable_extensions( $theme ) {
     
    278278     * @since 4.4.0
    279279     *
    280      * @param array    $default_types List of file types. Default types include 'php' and 'css'.
     280     * @param string[] $default_types List of allowed file types.
    281281     * @param WP_Theme $theme         The current Theme object.
    282282     */
     
    338338 * @since 4.9.0
    339339 *
    340  * @param array $args {
     340 * @param string[] $args {
    341341 *     Args. Note that all of the arg values are already unslashed. They are, however,
    342342 *     coming straight from `$_POST` and are not validated or sanitized in any way.
     
    663663 * @since 1.5.0
    664664 *
    665  * @param string $file          File the user is attempting to edit.
    666  * @param array  $allowed_files Optional. Array of allowed files to edit, $file must match an entry exactly.
    667  * @return string|null
     665 * @param string   $file          File the user is attempting to edit.
     666 * @param string[] $allowed_files Optional. Array of allowed files to edit. `$file` must match an entry exactly.
     667 * @return string|void Returns the file name on success, dies on failure.
    668668 */
    669669function validate_file_to_edit( $file, $allowed_files = array() ) {
     
    695695 * @see wp_handle_upload_error
    696696 *
    697  * @param array       $file      Reference to a single element of $_FILES. Call the function once for each uploaded file.
    698  * @param array|false $overrides An associative array of names => values to override default variables. Default false.
    699  * @param string      $time      Time formatted in 'yyyy/mm'.
    700  * @param string      $action    Expected value for $_POST['action'].
    701  * @return array On success, returns an associative array of file attributes. On failure, returns
    702  *               $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
     697 * @param string[]       $file      Reference to a single element of `$_FILES`. Call the function once for each uploaded file.
     698 * @param string[]|false $overrides An associative array of names => values to override default variables. Default false.
     699 * @param string         $time      Time formatted in 'yyyy/mm'.
     700 * @param string         $action    Expected value for `$_POST['action']`.
     701 * @return string[] On success, returns an associative array of file attributes. On failure, returns
     702 *               `$overrides['upload_error_handler'](&$file, $message )` or `array( 'error'=>$message )`.
    703703 */
    704704function _wp_handle_upload( &$file, $overrides, $time, $action ) {
     
    718718     * @since 4.0.0 Converted to a dynamic hook with `$action`.
    719719     *
    720      * @param array $file An array of data for a single file.
     720     * @param string[] $file An array of data for a single file.
    721721     */
    722722    $file = apply_filters( "{$action}_prefilter", $file );
Note: See TracChangeset for help on using the changeset viewer.