Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:25:10 PM (4 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/post-template.php

    r49021 r49193  
    457457function post_class( $class = '', $post_id = null ) {
    458458    // Separates classes with a single space, collates classes for post DIV.
    459     echo 'class="' . esc_attr( join( ' ', get_post_class( $class, $post_id ) ) ) . '"';
     459    echo 'class="' . esc_attr( implode( ' ', get_post_class( $class, $post_id ) ) ) . '"';
    460460}
    461461
     
    593593function body_class( $class = '' ) {
    594594    // Separates class names with a single space, collates class names for body element.
    595     echo 'class="' . esc_attr( join( ' ', get_body_class( $class ) ) ) . '"';
     595    echo 'class="' . esc_attr( implode( ' ', get_body_class( $class ) ) ) . '"';
    596596}
    597597
Note: See TracChangeset for help on using the changeset viewer.