WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 months ago

Last modified 3 months ago

#29008 closed enhancement (fixed)

Add additional variables to the_password_form filter

Reported by: silb3r Owned by: SergeyBiryukov
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-dev-note
Focuses: template Cc:

Description

This will vastly improve markup edits without resorting to str_replace().

Attachments (1)

additional_filter_variables_for_the_password_form.diff (553 bytes) - added by silb3r 7 years ago.
Additional filters for the_password_form filter

Download all attachments as: .zip

Change History (9)

@silb3r
7 years ago

Additional filters for the_password_form filter

#1 follow-up: @obenland
7 years ago

Hi silb3r, would you mind sharing you use case where you have to resort to str_replace()?

#2 in reply to: ↑ 1 @silb3r
7 years ago

Replying to obenland:

Hi silb3r, would you mind sharing you use case where you have to resort to str_replace()?

Use cases could be if you want to change the submit <input> into a <button> element or move the password <input> outside the <label> element.

...then again, perhaps the best solution is to move this markup out of PHP and into a template file.

Last edited 7 years ago by silb3r (previous) (diff)

#3 @obenland
7 years ago

  • Version trunk deleted

#4 @wonderboymusic
6 years ago

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

No movement in a year - as far as I can tell, the ID that $label represents is arbitrary and doesn't have to be maintained in a new UI

#5 @SergeyBiryukov
5 months ago

  • Milestone set to 5.8
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Related: #53091

It might be a good idea to pass the $post argument to the_password_form filter, for consistency with some other filters like the_title or post_password_required.

#6 @SergeyBiryukov
5 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from reopened to closed

In 50791:

Posts, Post Types: Pass the post object to the_password_form filter.

Props silb3r.
Fixes #29008.

#7 @audrasjb
5 months ago

  • Keywords needs-dev-note added
Note: See TracTickets for help on using tickets.