Make WordPress Core

Ticket #25448: 25448.diff

File 25448.diff, 5.9 KB (added by DrewAPicture, 11 years ago)

Fourth pass

  • src/wp-admin/edit-tag-form.php

     
    1818
    1919// Back compat hooks
    2020if ( 'category' == $taxonomy ) {
     21        /**
     22         * Fires before the Edit Category form.
     23         *
     24         * @since 2.1.0
     25         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     26         *
     27         * @param object $tag Current category term object.
     28         */
    2129        do_action( 'edit_category_form_pre', $tag );
    2230} elseif ( 'link_category' == $taxonomy ) {
     31        /**
     32         * Fires before the Edit Link Category form.
     33         *
     34         * @since 2.3.0
     35         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     36         *
     37         * @param object $tag Current link category term object.
     38         */
    2339        do_action( 'edit_link_category_form_pre', $tag );
    2440} else {
     41        /**
     42         * Fires before the Edit Tag form.
     43         *
     44         * @since 2.5.0
     45         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     46         *
     47         * @param object $tag Current tag term object.
     48         */
    2549        do_action( 'edit_tag_form_pre', $tag );
    2650}
     51/**
     52 * Fires before the Edit Term form for all taxonomies.
     53 *
     54 * The dynamic portion of the hook name, $taxonomy, refers to
     55 * the taxonomy slug.
     56 *
     57 * @since 3.0.0
     58 *
     59 * @param object $tag      Current taxonomy term object.
     60 * @param string $taxonomy Current $taxonomy slug.
     61 */
    2762do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
    2863
    2964<div class="wrap">
    3065<h2><?php echo $tax->labels->edit_item; ?></h2>
    3166<div id="ajax-response"></div>
    32 <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_edit_form_tag' ); ?>>
     67<?php
     68/**
     69 * Fires inside the Edit Term form tag.
     70 *
     71 * The dynamic portion of the hook name, $taxonomy, refers to
     72 * the taxonomy slug.
     73 *
     74 * @since 3.7.0
     75 */
     76?>
     77<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php do_action( "{$taxonomy}_term_edit_form_tag" ); ?>>
    3378<input type="hidden" name="action" value="editedtag" />
    3479<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
    3580<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy) ?>" />
     
    4388<?php if ( !global_terms_enabled() ) { ?>
    4489                <tr class="form-field">
    4590                        <th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
    46                         <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
     91                        <?php
     92                        /**
     93                         * Filter the editable term slug.
     94                         *
     95                         * @since 2.6.0
     96                         *
     97                         * @param string $slug The current term slug.
     98                         */
     99                        ?>
     100                        <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr( apply_filters( 'editable_slug', $tag->slug ) ); ?>" size="40" />
    47101                        <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>
    48102                </tr>
    49103<?php } ?>
     
    65119                </tr>
    66120                <?php
    67121                // Back compat hooks
    68                 if ( 'category' == $taxonomy )
    69                         do_action('edit_category_form_fields', $tag);
    70                 elseif ( 'link_category' == $taxonomy )
    71                         do_action('edit_link_category_form_fields', $tag);
    72                 else
    73                         do_action('edit_tag_form_fields', $tag);
    74 
    75                 do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
     122                if ( 'category' == $taxonomy ) {
     123                        /**
     124                         * Fires after the Edit Category form fields are displayed.
     125                         *
     126                         * @since 2.9.0
     127                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     128                         *
     129                         * @param object $tag Current category term object.
     130                         */
     131                        do_action( 'edit_category_form_fields', $tag );
     132                } elseif ( 'link_category' == $taxonomy ) {
     133                        /**
     134                         * Fires after the Edit Link Category form fields are displayed.
     135                         *
     136                         * @since 2.9.0
     137                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     138                         *
     139                         * @param object $tag Current link category term object.
     140                         */
     141                        do_action( 'edit_link_category_form_fields', $tag );
     142                } else {
     143                        /**
     144                         * Fires after the Edit Tag form fields are displayed.
     145                         *
     146                         * @since 2.9.0
     147                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     148                         *
     149                         * @param object $tag Current tag term object.
     150                         */
     151                        do_action( 'edit_tag_form_fields', $tag );
     152                }
     153                /**
     154                 * Fires after the Edit Term form fields are displayed.
     155                 *
     156                 * The dynamic portion of the hook name, $taxonomy, refers to
     157                 * the taxonomy slug.
     158                 *
     159                 * @since 3.0.0
     160                 *
     161                 * @param object $tag      Current taxonomy term object.
     162                 * @param string $taxonomy Current taxonomy slug.
     163                 */
     164                do_action( "{$taxonomy}_edit_form_fields", $tag, $taxonomy );
    76165                ?>
    77166        </table>
    78167<?php
    79168// Back compat hooks
    80 if ( 'category' == $taxonomy )
    81         do_action('edit_category_form', $tag);
    82 elseif ( 'link_category' == $taxonomy )
    83         do_action('edit_link_category_form', $tag);
    84 else
    85         do_action('edit_tag_form', $tag);
     169if ( 'category' == $taxonomy ) {
     170        /** This action is documented in wp-admin/edit-tags.php */
     171        do_action( 'edit_category_form', $tag );
     172} elseif ( 'link_category' == $taxonomy ) {
     173        /** This action is documented in wp-admin/edit-tags.php */
     174        do_action( 'edit_link_category_form', $tag );
     175} else {
     176        /**
     177         * Fires at the end of the Edit Term form.
     178         *
     179         * @since 2.5.0
     180         * @deprecated 3.0.0 Use {$taxonomy}_edit_form instead.
     181         *
     182         * @param object $tag Current taxonomy term object.
     183         */
     184        do_action( 'edit_tag_form', $tag );
     185}
     186/**
     187 * Fires at the end of the Edit Term form for all taxonomies.
     188 *
     189 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     190 *
     191 * @since 3.0.0
     192 *
     193 * @param object $tag      Current taxonomy term object.
     194 * @param string $taxonomy Current taxonomy slug.
     195 */
     196do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
    86197
    87 do_action($taxonomy . '_edit_form', $tag, $taxonomy);
    88 
    89198submit_button( __('Update') );
    90199?>
    91200</form>