-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ras-acc): make auth flow UI text filterable #3070
feat(ras-acc): make auth flow UI text filterable #3070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one suggestion.
} | ||
|
||
if ( ! $key ) { | ||
return array_merge( $default_labels, self::$reader_auth_labels ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a nit: this should be a deep merge, if the filter is to be used as suggested in the PR description. With the following use, the whole signin
key is replaced, and sub-keys' values other than title
are empty:
add_filter(
'newspack_reader_activation_auth_labels',
function( $labels ) {
return [
'signin' => [
'title' => 'banana',
],
];
}
);
The proper use of the filter in this case should be:
add_filter(
'newspack_reader_activation_auth_labels',
function( $labels ) {
$labels['signin']['title'] = 'banana';
return $labels;
}
);
Just pointing this out since there's an array_merge
in use, suggesting all defaults will be merged with what's supplied via the filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion!
Rather than perform a deep merge on every call to get_reader_auth_labels
though, I decided to adjust the logic for setting the labels cache to account for both usages of the filters above. Let me know what you think:
🍌🍌🍌 |
c69db08
to
5b42975
Compare
🎉 This PR is included in version 3.6.0-epic-ras-acc.10 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.9.0-epic-ras-acc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.1.0-epic-ras-acc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.2.0-epic-ras-acc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.4.0-epic-ras-acc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Closes https://app.asana.com/0/1206943664367847/1205669646691019/f
This PR makes the previously hard-coded reader activation auth flow text filterable:
Note: I have not made any of the errors, basic input labels and placeholders, or Google signin related text filterable. Let me know if you think any of these should be added.
How to test the changes in this Pull Request:
Other information: