Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 21 months ago

#25448 closed defect (bug) (fixed)

Hook Docs (14): wp-admin/edit-tag-form.php

Reported by: Japh Owned by: kpdesign
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch commit
Focuses: docs Cc:


Patch forthcoming.

Attachments (4)

edit-tag-form.diff (5.6 KB) - added by nicole@… 2 years ago.
Adding inline docs for hooks in wp-admin/edit-tag-form.php
edit-tag-form.2.diff (5.9 KB) - added by nicole@… 2 years ago.
25448.3.diff (6.0 KB) - added by kpdesign 2 years ago.
Third pass - formatting and description fixes
25448.diff (5.9 KB) - added by DrewAPicture 2 years ago.
Fourth pass

Download all attachments as: .zip

Change History (19)

#1 @kpdesign
2 years ago

  • Cc Japh added

Are you still working on this file?

#2 @DrewAPicture
2 years ago

Marking this as available on the master list

#3 @kpdesign
2 years ago

  • Cc Japh removed

2 years ago

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

#4 @nicole@…
2 years ago

Attached patch has docs for the following hooks in wp-admin/edit-tag-form.php:


  • editable_slug


  • edit_category_form_pre
  • edit_link_category_form_pre
  • edit_tag_form_pre
  • $taxonomy . '_pre_edit_form'
  • $taxonomy . '_term_edit_form_tag'
  • edit_category_form_fields
  • edit_link_category_form_fields
  • edit_tag_form_fields
  • $taxonomy . '_edit_form_fields'
  • edit_category_form
  • edit_link_category_form
  • edit_tag_form
  • $taxonomy . '_edit_form'

#5 @nicole@…
2 years ago

  • Cc nicole@… added
  • Keywords has-patch added; needs-patch removed

#6 @kpdesign
2 years ago

  • Keywords needs-patch added; has-patch removed

@nicolealleyinteractivecom: Thanks for the patch. :)


  • 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 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 */


  • 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 #15261 (see 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.

#7 @nicole@…
2 years ago

  • Keywords has-patch added; needs-patch removed

#8 @DrewAPicture
2 years ago

  • Owner set to kpdesign
  • Status changed from new to reviewing
  • Summary changed from Hook Docs: wp-admin/edit-tag-form.php to Hook Docs (14): wp-admin/edit-tag-form.php

2 years ago

Third pass - formatting and description fixes

#9 @kpdesign
2 years ago

25448.3.diff contains minor formatting and description fixes.

Ready for a second review and a recommendation.

2 years ago

Fourth pass

#10 @DrewAPicture
2 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9

25448.diff is a fourth pass. I cleaned up some of the terminology as the "Edit Tag" form is actually just reused for all taxonomies. Also, $taxonomy is a string, not an object.

Could use a once over for the fine details.

#11 @kpdesign
2 years ago

25448.diff looks good. Recommend commit.

#12 @DrewAPicture
2 years ago

FYI, nicolealleyinteractivecom will be credited for the nicole@... contributions.

#13 @DrewAPicture
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 26895:

Inline documentation for hooks in wp-admin/edit-tag-form.php.

Props nicolealleyinteractivecom, kpdesign.
Fixes #25448.

#14 @DrewAPicture
21 months ago

  • Focuses docs added

#15 @DrewAPicture
21 months ago

  • Component changed from Inline Docs to Taxonomy
Note: See TracTickets for help on using tickets.