Make WordPress Core

Ticket #25448: edit-tag-form.diff

File edit-tag-form.diff, 5.6 KB (added by nicole@…, 11 years ago)

Adding inline docs for hooks in wp-admin/edit-tag-form.php

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

     
    1818
    1919// Back compat hooks
    2020if ( 'category' == $taxonomy )
     21        /**
     22         * Fires before the edit tag form is displayed.
     23         *
     24         * This action is used for backward compatibility.
     25         * Use $taxonomy_pre_edit_form instead
     26         *
     27         * @since 2.1.0
     28         *
     29         * @param object $tag Current category object.
     30         */
    2131        do_action('edit_category_form_pre', $tag );
    2232elseif ( 'link_category' == $taxonomy )
     33        /**
     34         * Fires before the edit link category form is displayed.
     35         *
     36         * This action is used for backward compatibility.
     37         * Use $taxonomy_pre_edit_form instead
     38         *
     39         * @since 2.3.0
     40         *
     41         * @param object $tag Current link category object.
     42         */
    2343        do_action('edit_link_category_form_pre', $tag );
    2444else
     45        /**
     46         * Fires before the edit tag form is displayed.
     47         *
     48         * This action is used for backward compatibility.
     49         * Use $taxonomy_pre_edit_form instead
     50         *
     51         * @since 2.5.0
     52         *
     53         * @param object $tag Current tag object.
     54         */
    2555        do_action('edit_tag_form_pre', $tag);
    2656
     57/**
     58 * Fires before the edit taxonomy term form is displayed.
     59 *
     60 * @since 3.0.0
     61 *
     62 * @param object $tag Current taxonomy term object.
     63 * @param object $taxonomy Current $taxonomy object.
     64 */
    2765do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
    2866
    2967<div class="wrap">
    3068<?php screen_icon(); ?>
    3169<h2><?php echo $tax->labels->edit_item; ?></h2>
    3270<div id="ajax-response"></div>
     71<?php
     72/**
     73 * Fires before the edit link category form is displayed.
     74 *
     75 * @since 2.1.0
     76 *
     77 * @param object $taxonomy Current taxonomy object.
     78 */
     79?>
    3380<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_edit_form_tag' ); ?>>
    3481<input type="hidden" name="action" value="editedtag" />
    3582<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
     
    4491<?php if ( !global_terms_enabled() ) { ?>
    4592                <tr class="form-field">
    4693                        <th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
     94                        <?php
     95                        /**
     96                         * Filter the editable slug.
     97                         *
     98                         * @since 2.6.0
     99                         *
     100                         * @param string $tag->slug The current tag's slug.
     101                         */
     102                        ?>
    47103                        <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" />
    48104                        <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>
    49105                </tr>
     
    67123                <?php
    68124                // Back compat hooks
    69125                if ( 'category' == $taxonomy )
     126                        /**
     127                         * Fires after the edit category form fields are displayed.
     128                         *
     129                         * This action is used for backward compatibility.
     130                         * Use $taxonomy_edit_form_fields instead
     131                         *
     132                         * @since 2.9.0
     133                         *
     134                         * @param object $tag Current taxonomy object.
     135                         */
    70136                        do_action('edit_category_form_fields', $tag);
    71137                elseif ( 'link_category' == $taxonomy )
     138                        /**
     139                         * Fires after the edit link category form fields are displayed.
     140                         *
     141                         * This action is used for backward compatibility.
     142                         * Use $taxonomy_edit_form_fields instead
     143                         *
     144                         * @since 2.9.0
     145                         *
     146                         * @param object $tag Current taxonomy object.
     147                         */
    72148                        do_action('edit_link_category_form_fields', $tag);
    73149                else
     150                        /**
     151                         * Fires after the edit tag form fields are displayed.
     152                         *
     153                         * This action is used for backward compatibility.
     154                         * Use $taxonomy_edit_form_fields instead
     155                         *
     156                         * @since 2.9.0
     157                         *
     158                         * @param object $tag Current taxonomy object.
     159                         */
    74160                        do_action('edit_tag_form_fields', $tag);
    75161
     162                /**
     163                 * Fires after the taxonomy edit form fields are displayed.
     164                 *
     165                 * This action fires inside the form, before the closing
     166                 * table tag.
     167                 *
     168                 * @since 3.0.0
     169                 *
     170                 * @param object $tag Current taxonomy term object.
     171                 * @param object $taxonomy Current taxonomy object.
     172                 */
    76173                do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
    77174                ?>
    78175        </table>
    79176<?php
    80177// Back compat hooks
    81178if ( 'category' == $taxonomy )
     179        /**
     180         * Fires after the edit tag form table is displayed.
     181         *
     182         * This action is used for backward compatibility.
     183         * Use $taxonomy_edit_form instead
     184         *
     185         * @since 2.1.0
     186         *
     187         * @param object $tag Current taxonomy object.
     188         */
    82189        do_action('edit_category_form', $tag);
    83190elseif ( 'link_category' == $taxonomy )
     191        /**
     192         * Fires after the edit tag form table is displayed.
     193         *
     194         * This action is used for backward compatibility.
     195         * Use $taxonomy_edit_form instead
     196         *
     197         * @since 2.3.0
     198         *
     199         * @param object $tag Current taxonomy object.
     200         */
    84201        do_action('edit_link_category_form', $tag);
    85202else
     203        /**
     204         * Fires after the edit tag form table is displayed.
     205         *
     206         * This action is used for backward compatibility.
     207         * Use $taxonomy_edit_form instead
     208         *
     209         * @since 2.5.0
     210         *
     211         * @param object $tag Current taxonomy object.
     212         */
    86213        do_action('edit_tag_form', $tag);
    87214
     215/**
     216 * Fires after the taxonomy edit form table is displayed.
     217 *
     218 * This action fires inside the form, after the closing
     219 * table tag.
     220 *
     221 * @since 3.0.0
     222 *
     223 * @param object $tag Current taxonomy term object.
     224 * @param object $taxonomy Current taxonomy object.
     225 */
    88226do_action($taxonomy . '_edit_form', $tag, $taxonomy);
    89227
    90228submit_button( __('Update') );
     
    93231</div>
    94232<script type="text/javascript">
    95233try{document.forms.edittag.name.focus();}catch(e){}
    96 </script>
     234</script>
     235 No newline at end of file