Make WordPress Core


Ignore:
Timestamp:
01/08/2022 01:20:13 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/themes.php.

Follow-up to [15646], [30697].

See #54728.

File:
1 edited

Legend:

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

    r52353 r52540  
    7575
    7676        $active = wp_get_theme();
    77         if ( $active->get( 'Template' ) == $_GET['stylesheet'] ) {
     77        if ( $active->get( 'Template' ) === $_GET['stylesheet'] ) {
    7878            wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) );
    7979        } else {
     
    321321            continue;
    322322        }
     323
    323324        // 0 = name, 1 = capability, 2 = file.
    324         if ( ( strcmp( $self, $item[2] ) == 0 && empty( $parent_file ) ) || ( $parent_file && ( $item[2] == $parent_file ) ) ) {
     325        if ( 0 === strcmp( $self, $item[2] ) && empty( $parent_file )
     326            || $parent_file && $item[2] === $parent_file
     327        ) {
    325328            $class = ' current';
    326329        }
     330
    327331        if ( ! empty( $submenu[ $item[2] ] ) ) {
    328332            $submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index.
    329333            $menu_hook           = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] );
     334
    330335            if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) {
    331336                $current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
Note: See TracChangeset for help on using the changeset viewer.