WordPress.org

Make WordPress Core

Changeset 42679


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

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

Props janak007

See #41756

Location:
trunk/src/wp-admin/includes
Files:
2 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 );
  • trunk/src/wp-admin/includes/nav-menu.php

    r42343 r42679  
    462462                 * @since 4.9.0 Added the `$recent_args` parameter.
    463463                 *
    464                  * @param array $most_recent An array of post objects being listed.
    465                  * @param array $args        An array of WP_Query arguments for the meta box.
    466                  * @param array $box         Arguments passed to wp_nav_menu_item_post_type_meta_box().
    467                  * @param array $recent_args An array of WP_Query arguments for 'Most Recent' tab.
     464                 * @param WP_Post[] $most_recent An array of post objects being listed.
     465                 * @param array     $args        An array of `WP_Query` arguments for the meta box.
     466                 * @param array     $box         Arguments passed to `wp_nav_menu_item_post_type_meta_box()`.
     467                 * @param array     $recent_args An array of `WP_Query` arguments for 'Most Recent' tab.
    468468                 */
    469469                $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args );
     
    590590                 * @see WP_Query::query()
    591591                 *
    592                  * @param array        $posts     The posts for the current post type.
    593                  * @param array        $args      An array of WP_Query arguments.
     592                 * @param object[]     $posts     The posts for the current post type. Mostly `WP_Post` objects, but
     593                 *                                can also contain "fake" post objects to represent other menu items.
     594                 * @param array        $args      An array of `WP_Query` arguments.
    594595                 * @param WP_Post_Type $post_type The current post type object for this menu item meta box.
    595596                 */
     
    890891 * @since 3.0.0
    891892 *
    892  * @param int $menu_id The menu ID for which to save this item. $menu_id of 0 makes a draft, orphaned menu item.
    893  * @param array $menu_data The unsanitized posted menu item data.
    894  * @return array The database IDs of the items saved
     893 * @param int     $menu_id   The menu ID for which to save this item. Value of 0 makes a draft, orphaned menu item. Default 0.
     894 * @param array[] $menu_data The unsanitized POSTed menu item data.
     895 * @return int[] The database IDs of the items saved
    895896 */
    896897function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {
Note: See TracChangeset for help on using the changeset viewer.