Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:25:10 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Replace alias PHP functions with the canonical names.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:

  • join() with implode()
  • sizeof() with count()
  • is_writeable() with is_writable()
  • doubleval() with a (float) cast

In part, this is a follow-up to #47746.

Props jrf.
See #50767.

File:
1 edited

Legend:

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

    r48695 r49193  
    205205         * @param callable $handler Audio embed handler callback function.
    206206         */
    207         wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
     207        wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . implode( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
    208208
    209209        /**
     
    214214         * @param callable $handler Video embed handler callback function.
    215215         */
    216         wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
     216        wp_embed_register_handler( 'video', '#^https?://.+?\.(' . implode( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
    217217}
    218218
     
    842842        if ( isset( $attrs['title'] ) ) {
    843843                unset( $attrs['title'] );
    844                 $attr_string = join( ' ', wp_list_pluck( $attrs, 'whole' ) );
     844                $attr_string = implode( ' ', wp_list_pluck( $attrs, 'whole' ) );
    845845                $result      = str_replace( $matches[0], '<iframe ' . trim( $attr_string ) . '>', $result );
    846846        }
Note: See TracChangeset for help on using the changeset viewer.