WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 4 months ago

Last modified 8 weeks 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:

Description

Patch forthcoming.

Attachments (4)

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

Download all attachments as: .zip

Change History (19)

comment:1 kpdesign6 months ago

  • Cc Japh added

Are you still working on this file?

comment:2 DrewAPicture6 months ago

Marking this as available on the master list

comment:3 kpdesign6 months ago

  • Cc Japh removed

nicole@…5 months ago

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

comment:4 nicole@…5 months ago

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

Filters:

  • editable_slug

Actions:

  • 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'

comment:5 nicole@…5 months ago

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

comment:6 kpdesign5 months ago

  • Keywords needs-patch added; has-patch removed

@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 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 #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.

nicole@…5 months ago

comment:7 nicole@…5 months ago

  • Keywords has-patch added; needs-patch removed

comment:8 DrewAPicture4 months 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

kpdesign4 months ago

Third pass - formatting and description fixes

comment:9 kpdesign4 months ago

25448.3.diff contains minor formatting and description fixes.

Ready for a second review and a recommendation.

DrewAPicture4 months ago

Fourth pass

comment:10 DrewAPicture4 months 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.

comment:11 kpdesign4 months ago

25448.diff looks good. Recommend commit.

comment:12 DrewAPicture4 months ago

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

comment:13 DrewAPicture4 months 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.

comment:14 DrewAPicture8 weeks ago

  • Focuses docs added

comment:15 DrewAPicture8 weeks ago

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