[wp-trac] [WordPress Trac] #25448: Hook Docs: wp-admin/edit-tag-form.php

WordPress Trac noreply at wordpress.org
Wed Nov 27 18:53:17 UTC 2013


#25448: Hook Docs: wp-admin/edit-tag-form.php
--------------------------+------------------------------
 Reporter:  Japh          |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Inline Docs   |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------
Changes (by kpdesign):

 * keywords:  has-patch => needs-patch


Comment:

 @nicolealleyinteractivecom: Thanks for the patch. :)

 General:

 * The following hooks are the "edit" versions of the corresponding "add"
 hooks in wp-admin/edit-tags.php:
   - `edit_category_form_pre` (see add_category_form_pre)
   - `edit_link_category_form_pre` (see add_link_category_form_pre)
   - `edit_tag_form_pre` (see add_tag_form_pre)
   - `{$taxonomy}_pre_edit_form` (see {$taxonomy}_pre_add_form)
   - `$taxonomy . '_term_edit_form_tag` (see {$taxonomy}_term_new_form_tag)
   - `edit_tag_form_fields` (see add_tag_form_fields)
   - `$taxonomy . '_edit_form_fields` (see {$taxonomy}_add_form_fields)
   - `edit_tag_form` (see add_tag_form)
   - `$taxonomy . '_edit_form'` (see {$taxonomy}_add_form)
 * I would recommend looking at the corresponding doc blocks for those
 hooks in wp-admin/edit-tags.php, and model the edit version of the doc
 blocks here after them. Some of them have long descriptions, such as "The
 dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug."
 that are applicable to the hooks here as well. For the back-compat hooks,
 remove the long description, and add the @deprecated line with the
 applicable "Use ''hook_name'' instead." text under @since.

 * In short descriptions, capitalize the name of the form, e.g. edit
 category/Edit Category, edit link category/Edit Link Category, etc.

 * Space out the do_action/apply_filters lines per the
 [http://make.wordpress.org/core/handbook/coding-standards/php/#space-usage
 coding standards]. For example: `do_action('edit_category_form_fields',
 $tag);` should be: `do_action( 'edit_category_form_fields', $tag );`

 `edit_category_form` and `edit_link_category_form`:
 - These are duplicate hooks, so you can replace the doc blocks with `/**
 This action is documented in wp-admin/edit-tags.php */`

 `editable_slug`:
 - Change the variable in the @param to a docs-specific variable, such as
 `$slug`.

 `edit_category_form_fields` and `edit_link_category_form_fields`:
 - Remove the long description, and add "@deprecated 3.0.0 Use
 $taxonomy_edit_form_fields instead." directly under @since.

 `$taxonomy . '_term_edit_form_tag`:
 - @since should be 3.7.0 - this was a new hook introduced in
 [ticket:#15261] (see [changeset:25034]).
 - Remove the @param line, as `$taxonomy` is part of the hook name.

 Could you make these changes, and submit a new patch please?

 Note: Don't check the box to overwrite your existing patch - if you use
 the same filename, Trac will automatically append a .2 to the name to
 prevent it from being overwritten.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25448#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list