Make WordPress Core

Changeset 63347


Ignore:
Timestamp:
08/25/2026 10:27:47 PM (17 hours ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Replace remaining join() aliases with implode().

join() is an alias of implode(). Using the canonical function name is strongly recommended, as aliases may be deprecated or removed without (much) warning. This replaces the last three uses of the alias in actively maintained PHP code.

Developed in https://github.com/WordPress/wordpress-develop/pull/13263.

Follow-up to [49193], [49200], [56616], [57567], [60704], [61326].

Props Soean, mukesh27.
See #65818.

Location:
trunk
Files:
3 edited

Legend:

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

    r63060 r63347  
    987987                                        return false;
    988988                                }
    989                                 $where .= " AND post_type IN ('" . join( "', '", esc_sql( $post_types ) ) . "')";
     989                                $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $post_types ) ) . "')";
    990990                        } else {
    991991                                if ( ! in_array( get_query_var( 'post_type' ), $publicly_viewable_post_types, true ) ) {
  • trunk/tests/phpunit/tests/functions/wpGetArchives.php

    r61519 r63347  
    221221                $ids = array_slice( array_reverse( self::$post_ids ), 0, 3 );
    222222
    223                 $expected = join(
     223                $expected = implode(
    224224                        '',
    225225                        array_map(
  • trunk/tests/phpunit/tests/script-modules/wpScriptModules.php

    r62807 r63347  
    487487                                        $key_parts[] = sprintf( '%s_%s', $param_name, json_encode( $param_value ) );
    488488                                }
    489                                 $data[ join( '_', $key_parts ) ] = $test_case;
     489                                $data[ implode( '_', $key_parts ) ] = $test_case;
    490490                        }
    491491                }
Note: See TracChangeset for help on using the changeset viewer.