WordPress.org

Make WordPress Core

Changeset 46131


Ignore:
Timestamp:
09/15/2019 11:11:14 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Code Modernisation: Introduce the spread operator in wp-admin/includes/media.php.

Rather than relying func_get_args() to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

File:
1 edited

Legend:

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

    r45934 r46131  
    521521 * @param mixed    ...$args      Optional additional parameters to pass to the callback function when it's called.
    522522 */
    523 function wp_iframe( $content_func ) {
     523function wp_iframe( $content_func, ...$args ) {
    524524    _wp_admin_html_begin();
    525525    ?>
     
    607607    <?php
    608608
    609     $args = func_get_args();
    610     $args = array_slice( $args, 1 );
    611609    call_user_func_array( $content_func, $args );
    612610
Note: See TracChangeset for help on using the changeset viewer.