WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (2 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r42217 r42343  
    1515if ( 'category' == $taxonomy ) {
    1616    /**
    17      * Fires before the Edit Category form.
     17     * Fires before the Edit Category form.
    1818     *
    1919     * @since 2.1.0
     
    7575    <p><strong><?php echo $message; ?></strong></p>
    7676    <?php if ( $wp_http_referer ) { ?>
    77     <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"><?php
    78         echo esc_html( $tax->labels->back_to_items );
    79     ?></a></p>
     77    <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>">
     78                            <?php
     79                            echo esc_html( $tax->labels->back_to_items );
     80    ?>
     81    </a></p>
    8082    <?php } ?>
    8183</div>
     
    8486<div id="ajax-response"></div>
    8587
    86 <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php
     88<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"
     89<?php
    8790/**
    8891 * Fires inside the Edit Term form tag.
     
    9396 */
    9497do_action( "{$taxonomy}_term_edit_form_tag" );
    95 ?>>
     98?>
     99>
    96100<input type="hidden" name="action" value="editedtag"/>
    97 <input type="hidden" name="tag_ID" value="<?php echo esc_attr( $tag_ID ) ?>"/>
    98 <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ) ?>"/>
     101<input type="hidden" name="tag_ID" value="<?php echo esc_attr( $tag_ID ); ?>"/>
     102<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>"/>
    99103<?php
    100104wp_original_referer_field( true, 'previous' );
     
    124128            <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
    125129            <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
    126             <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
    127         </tr>
    128 <?php if ( !global_terms_enabled() ) { ?>
     130            <p class="description"><?php _e( 'The name is how it appears on your site.' ); ?></p></td>
     131        </tr>
     132<?php if ( ! global_terms_enabled() ) { ?>
    129133        <tr class="form-field term-slug-wrap">
    130134            <th scope="row"><label for="slug"><?php _e( 'Slug' ); ?></label></th>
     
    146150            ?>
    147151            <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" />
    148             <p class="description"><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
     152            <p class="description"><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p></td>
    149153        </tr>
    150154<?php } ?>
    151 <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
     155<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
    152156        <tr class="form-field term-parent-wrap">
    153157            <th scope="row"><label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label></th>
     
    168172                /** This filter is documented in wp-admin/edit-tags.php */
    169173                $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' );
    170                 wp_dropdown_categories( $dropdown_args ); ?>
     174                wp_dropdown_categories( $dropdown_args );
     175                ?>
    171176                <?php if ( 'category' == $taxonomy ) : ?>
    172177                    <p class="description"><?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>
     
    180185            <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th>
    181186            <td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea>
    182             <p class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p></td>
     187            <p class="description"><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p></td>
    183188        </tr>
    184189        <?php
     
    267272    <?php if ( current_user_can( 'delete_term', $tag->term_id ) ) : ?>
    268273        <span id="delete-link">
    269             <a class="delete" href="<?php echo admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ) ?>"><?php _e( 'Delete' ); ?></a>
     274            <a class="delete" href="<?php echo admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ); ?>"><?php _e( 'Delete' ); ?></a>
    270275        </span>
    271276    <?php endif; ?>
     
    280285try{document.forms.edittag.name.focus();}catch(e){}
    281286</script>
    282 <?php endif;
     287<?php
     288endif;
Note: See TracChangeset for help on using the changeset viewer.