Make WordPress Core

Ticket #25448: edit-tag-form.2.diff

File edit-tag-form.2.diff, 5.9 KB (added by nicole@…, 11 years ago)
  • wp-admin/edit-tag-form.php

     
    1616        return;
    1717}
    1818
    19 // Back compat hooks
    2019if ( 'category' == $taxonomy ) {
     20        /**
     21         * Fires before the Edit Category form.
     22         *
     23         * @since 2.1.0
     24         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     25         *
     26         * @param object $tag Current category object.
     27         */
    2128        do_action( 'edit_category_form_pre', $tag );
    2229} elseif ( 'link_category' == $taxonomy ) {
     30        /**
     31         * Fires before the Edit Link Category form.
     32         *
     33         * @since 2.3.0
     34         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     35         *
     36         * @param object $tag Current link category object.
     37         */
    2338        do_action( 'edit_link_category_form_pre', $tag );
    2439} else {
     40        /**
     41         * Fires before the Edit Tag form.
     42         *
     43         * @since 2.5.0
     44         * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead.
     45         *
     46         * @param object $tag Current tag object.
     47         */
    2548        do_action( 'edit_tag_form_pre', $tag );
    2649}
     50/**
     51 * Fires before the Edit Term form for all taxonomies.
     52 *
     53 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     54 *
     55 * @since 3.0.0
     56 *
     57 * @param object $tag Current taxonomy term object.
     58 * @param object $taxonomy Current $taxonomy object.
     59 */
    2760do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
    2861
    2962<div class="wrap">
    3063<h2><?php echo $tax->labels->edit_item; ?></h2>
    3164<div id="ajax-response"></div>
     65<?php
     66/**
     67 * Fires before the Edit Tag form is displayed.
     68 *
     69 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     70 *
     71 * @since 3.7.0
     72 */
     73?>
    3274<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_edit_form_tag' ); ?>>
    3375<input type="hidden" name="action" value="editedtag" />
    3476<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
     
    4385<?php if ( !global_terms_enabled() ) { ?>
    4486                <tr class="form-field">
    4587                        <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" />
     88                        <?php
     89                        /**
     90                         * Filter the editable slug.
     91                         *
     92                         * @since 2.6.0
     93                         *
     94                         * @param string $slug The current tag's slug.
     95                         */
     96                        ?>
     97                        <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" />
    4798                        <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>
    4899                </tr>
    49100<?php } ?>
     
    64115                        <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
    65116                </tr>
    66117                <?php
    67                 // 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);
     118                if ( 'category' == $taxonomy ) {
     119                        /**
     120                         * Fires after the Edit Category form fields are displayed.
     121                         *
     122                         * @since 2.9.0
     123                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     124                         *
     125                         * @param object $tag Current taxonomy object.
     126                         */
     127                        do_action( 'edit_category_form_fields', $tag );
     128                } elseif ( 'link_category' == $taxonomy ) {
     129                        /**
     130                         * Fires after the Edit Link Category form fields are displayed.
     131                         *
     132                         * @since 2.9.0
     133                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     134                         *
     135                         * @param object $tag Current taxonomy object.
     136                         */
     137                        do_action( 'edit_link_category_form_fields', $tag );
     138                } else {
     139                        /**
     140                         * Fires after the Edit Tag form fields are displayed.
     141                         *
     142                         * @since 2.9.0
     143                         * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead.
     144                         *
     145                         * @param object $tag Current taxonomy object.
     146                         */
     147                        do_action( 'edit_tag_form_fields', $tag );
     148                }
     149                /**
     150                 * Fires after the Taxonomy Edit form fields are displayed.
     151                 *
     152                 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     153                 *
     154                 * @since 3.0.0
     155                 *
     156                 * @param object $tag Current taxonomy term object.
     157                 * @param object $taxonomy Current taxonomy object.
     158                 */
     159                do_action( $taxonomy . '_edit_form_fields', $tag, $taxonomy );
    76160                ?>
    77161        </table>
    78162<?php
    79163// 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);
     164if ( 'category' == $taxonomy ) {
     165        /** This action is documented in wp-admin/edit-tags.php */
     166        do_action( 'edit_category_form', $tag );
     167} elseif ( 'link_category' == $taxonomy ) {
     168        /** This action is documented in wp-admin/edit-tags.php */
     169        do_action( 'edit_link_category_form', $tag );
     170} else {
     171        /**
     172         * Fires after the Edit Tag form table is displayed.
     173         *
     174         * @since 2.5.0
     175         * @deprecated 3.0.0 Use {$taxonomy}_edit_form instead.
     176         *
     177         * @param object $tag Current taxonomy object.
     178         */
     179        do_action( 'edit_tag_form', $tag );
     180}
     181/**
     182 * Fires after the taxonomy edit form table is displayed.
     183 *
     184 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     185 *
     186 * @since 3.0.0
     187 *
     188 * @param object $tag Current taxonomy term object.
     189 * @param object $taxonomy Current taxonomy object.
     190 */
     191do_action( $taxonomy . '_edit_form', $tag, $taxonomy );
    86192
    87 do_action($taxonomy . '_edit_form', $tag, $taxonomy);
    88 
    89193submit_button( __('Update') );
    90194?>
    91195</form>
    92196</div>
    93197<script type="text/javascript">
    94198try{document.forms.edittag.name.focus();}catch(e){}
    95 </script>
     199</script>
     200 No newline at end of file