Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#38104 closed defect (bug) (fixed)

form html tag is not properly closed, using {$taxonomy}_term_new_form_tag causes incorrect html output

Reported by: bjornw's profile BjornW Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.7 Priority: normal
Severity: normal Version: 3.7
Component: Taxonomy Keywords:
Focuses: Cc:

Description

As you can see in edit-tags.php the html form tag is not properly closed:

<form id="addtag" method="post" action="edit-tags.php" class="validate"
<?php
/**
 * Fires at the beginning of the Add Tag form.
 *
 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
 *
 * @since 3.7.0
 */
do_action( "{$taxonomy}_term_new_form_tag" );
?>>

This causes incorrect html output when using the {$taxonomy}_term_new_form_tag action.

Attachments (2)

38104.patch (831 bytes) - added by BjornW 8 years ago.
Patch which properly closes the form tag
38104-2.patch (586 bytes) - added by BjornW 8 years ago.
Clarify the intent and usage of the action in the docblock no code changes

Download all attachments as: .zip

Change History (11)

@BjornW
8 years ago

Patch which properly closes the form tag

#1 @BjornW
8 years ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core by bjornw. View the logs.


8 years ago

#3 follow-up: @ericlewis
8 years ago

This action is intended to be fired within the <form> tag to allow developers to add element attributes, eg the form encoding. See #15261.

#4 in reply to: ↑ 3 @BjornW
8 years ago

Hi @ericlewis,

Thanks for clearing this up, although I find this approach a bit strange. At least the action name should indicate that it is intended to be for adding additional attributes. I'd expect the current name to be used for adding new form fields above the default ones. I've added a new patch which makes the use of the action a bit clearer.

Replying to ericlewis:

This action is intended to be fired within the <form> tag to allow developers to add element attributes, eg the form encoding. See #15261.

@BjornW
8 years ago

Clarify the intent and usage of the action in the docblock no code changes

#5 @ericlewis
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Thanks for the patch @BjornW! To keep our tickets in order, I've opened #38108 for the documentation issue. I'm closing this ticket as the original bug report has been dealt with.

#6 @ericlewis
8 years ago

  • Keywords has-patch removed

#7 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Resolution changed from worksforme to fixed

In 38629:

Docs: Correct the description of {$taxonomy}_term_new_form_tag hook, making it more consistent with other *_form_tag hooks.

Props BjornW.
Fixes #38104.

#8 @SergeyBiryukov
8 years ago

  • Milestone set to 4.7
  • Version changed from trunk to 3.7

#9 @SergeyBiryukov
8 years ago

#38108 was marked as a duplicate.

Note: See TracTickets for help on using tickets.