Make WordPress Core

Changeset 46962


Ignore:
Timestamp:
12/15/2019 10:44:37 AM (5 years ago)
Author:
SergeyBiryukov
Message:

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

Props passoniate.
Fixes #48985.

File:
1 edited

Legend:

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

    r46823 r46962  
    4444$title = $tax->labels->name;
    4545
    46 if ( 'post' != $post_type ) {
    47     $parent_file  = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
     46if ( 'post' !== $post_type ) {
     47    $parent_file  = ( 'attachment' === $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
    4848    $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
    49 } elseif ( 'link_category' == $tax->name ) {
     49} elseif ( 'link_category' === $tax->name ) {
    5050    $parent_file  = 'link-manager.php';
    5151    $submenu_file = 'edit-tags.php?taxonomy=link_category';
     
    243243}
    244244
    245 if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
     245if ( 'category' === $taxonomy || 'link_category' === $taxonomy || 'post_tag' === $taxonomy ) {
    246246    $help = '';
    247     if ( 'category' == $taxonomy ) {
     247    if ( 'category' === $taxonomy ) {
    248248        $help = '<p>' . sprintf(
    249249            /* translators: %s: URL to Writing Settings screen. */
     
    251251            'options-writing.php'
    252252        ) . '</p>';
    253     } elseif ( 'link_category' == $taxonomy ) {
     253    } elseif ( 'link_category' === $taxonomy ) {
    254254        $help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
    255255    } else {
     
    257257    }
    258258
    259     if ( 'link_category' == $taxonomy ) {
     259    if ( 'link_category' === $taxonomy ) {
    260260        $help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';
    261261    } else {
     
    271271    );
    272272
    273     if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
    274         if ( 'category' == $taxonomy ) {
     273    if ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) {
     274        if ( 'category' === $taxonomy ) {
    275275            $help = '<p>' . __( 'When adding a new category on this screen, you&#8217;ll fill in the following fields:' ) . '</p>';
    276276        } else {
     
    285285        }
    286286
    287         if ( 'category' == $taxonomy ) {
     287        if ( 'category' === $taxonomy ) {
    288288            $help .= '<li>' . __( '<strong>Parent</strong> &mdash; Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
    289289        }
     
    296296            array(
    297297                'id'      => 'adding-terms',
    298                 'title'   => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
     298                'title'   => 'category' === $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
    299299                'content' => $help,
    300300            )
     
    304304    $help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
    305305
    306     if ( 'category' == $taxonomy ) {
     306    if ( 'category' === $taxonomy ) {
    307307        $help .= '<p>' . __( '<a href="https://wordpress.org/support/article/posts-categories-screen/">Documentation on Categories</a>' ) . '</p>';
    308     } elseif ( 'link_category' == $taxonomy ) {
     308    } elseif ( 'link_category' === $taxonomy ) {
    309309        $help .= '<p>' . __( '<a href="https://codex.wordpress.org/Links_Link_Categories_Screen">Documentation on Link Categories</a>' ) . '</p>';
    310310    } else {
     
    373373
    374374    <?php
    375     if ( 'category' == $taxonomy ) {
     375    if ( 'category' === $taxonomy ) {
    376376        /**
    377377         * Fires before the Add Category form.
     
    383383         */
    384384        do_action_deprecated( 'add_category_form_pre', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' );
    385     } elseif ( 'link_category' == $taxonomy ) {
     385    } elseif ( 'link_category' === $taxonomy ) {
    386386        /**
    387387         * Fires before the link category form.
     
    488488        wp_dropdown_categories( $dropdown_args );
    489489        ?>
    490         <?php if ( 'category' == $taxonomy ) : ?>
     490        <?php if ( 'category' === $taxonomy ) : ?>
    491491        <p><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
    492492    <?php else : ?>
     
    529529    </p>
    530530    <?php
    531     if ( 'category' == $taxonomy ) {
     531    if ( 'category' === $taxonomy ) {
    532532        /**
    533533         * Fires at the end of the Edit Category form.
     
    539539         */
    540540        do_action_deprecated( 'edit_category_form', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_add_form' );
    541     } elseif ( 'link_category' == $taxonomy ) {
     541    } elseif ( 'link_category' === $taxonomy ) {
    542542        /**
    543543         * Fires at the end of the Edit Link form.
     
    590590</form>
    591591
    592 <?php if ( 'category' == $taxonomy ) : ?>
     592<?php if ( 'category' === $taxonomy ) : ?>
    593593<div class="form-wrap edit-term-notes">
    594594<p>
     
    614614    <?php endif; ?>
    615615</div>
    616 <?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
     616<?php elseif ( 'post_tag' === $taxonomy && current_user_can( 'import' ) ) : ?>
    617617<div class="form-wrap edit-term-notes">
    618618<p>
Note: See TracChangeset for help on using the changeset viewer.