Deprecate the action and introduce filter #8267
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trac Ticket: Core-52721
Summary
This PR introduces a change to the
wp_signon
function, deprecating thewp_authenticate
action and replacing it with a filter,wp_signon_credentials
.Key Changes
wp_authenticate
action and added the newwp_signon_credentials
filter.Why This Change
The shift from the
wp_authenticate
action to a filter is driven by the need for more flexible and streamlined handling of login credentials. The action wp_authenticate only allowed for limited modification of the credentials, and its callback structure was not as versatile as using a filter.The
wp_authenticate
action is a legacy mechanism that lacks flexibility for modern development. This PR deprecates it and introduces thewp_signon_credentials
filter, offering a more extensible and standardized way to modify sign-on credentials. This change improves control over the login process, aligns with best practices, and ensures cleaner, more maintainable code. It also addresses the@todo from [27353]
, which questioned the deprecation of the action, by replacing it with the filter for improved flexibility while maintaining backward compatibility.