WordPress.org

Make WordPress Core

Opened 2 weeks ago

Last modified 12 days ago

#44332 new enhancement

Hook retreive_password (depricated) should be removed

Reported by: subrataemfluence Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 1.5.1
Component: Users Keywords: needs-patch
Focuses: Cc:

Description

Since the function retreive_password no longer exists in the framework any more, I think we should remove it from get_password_reset_key function. Currently it has documented as

* @deprecated 1.5.1 Misspelled. Use 'retrieve_password' hook instead.
  • File: wp-includes/user.php
  • Line number: 2205

Proposed patch added.

Attachments (1)

44332.diff (648 bytes) - added by subrataemfluence 2 weeks ago.

Download all attachments as: .zip

Change History (4)

#1 follow-up: @birgire
2 weeks ago

  • Version set to 1.5.1

There's also the do_action_deprecated() function introduced in 4.6:

When an action hook is deprecated, the do_action() call is replaced with do_action_deprecated(), which triggers a deprecation notice and then fires the original hook.

Similarly the apply_filters_deprecated() function for deprecated filters.

So in this case it might be replaced with:

do_action_deprecated( 'retreive_password', array( $user->user_login ), '1.5.1', 'retrieve_password' );

It would be interesting to scan the wordpress.org plugin repository to see if any plugin is using this deprecated filter.

@subrataemfluence, what do you think about this kind of approach, before removing?

Last edited 2 weeks ago by birgire (previous) (diff)

#2 @ocean90
2 weeks ago

  • Keywords needs-patch added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

+1 for do_action_deprecated().

#3 in reply to: ↑ 1 @subrataemfluence
12 days ago

Perfect! I love the idea. Still a learner :)

Replying to birgire:

There's also the do_action_deprecated() function introduced in 4.6:

When an action hook is deprecated, the do_action() call is replaced with do_action_deprecated(), which triggers a deprecation notice and then fires the original hook.

Similarly the apply_filters_deprecated() function for deprecated filters.

So in this case it might be replaced with:

do_action_deprecated( 'retreive_password', array( $user->user_login ), '1.5.1', 'retrieve_password' );

It would be interesting to scan the wordpress.org plugin repository to see if any plugin is using this deprecated filter.

@subrataemfluence, what do you think about this kind of approach, before removing?

Note: See TracTickets for help on using tickets.