Repository navigation
Wordpress 51884 - #844
Wordpress 51884#844Yeora wants to merge 18 commits into
Conversation
|
Hi @Yeora! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
iandunn
left a comment
There was a problem hiding this comment.
Thanks! This is looking good at first glance.
We'll still need a designer to check the UI, since it'll be hard to communicate to users that clearing will result in IP geolocation.
After that the code will need a deeper review.
| requestParams._wpnonce = communityEventsData.nonce; | ||
| requestParams.timezone = window.Intl ? window.Intl.DateTimeFormat().resolvedOptions().timeZone : ''; | ||
| initiatedBy = requestParams.location ? 'user' : 'app'; | ||
|
|
There was a problem hiding this comment.
This would be the 3rd place the above code is duplicated. It'd be nice to create a getRequestParams() function to keep it DRY.
| function wp_ajax_clear_community_events() { | ||
| check_ajax_referer( 'community_events' ); | ||
| $user_id = get_current_user_id(); | ||
| update_user_option( $user_id, 'community-events-location', null, true ); |
There was a problem hiding this comment.
It feels a bit more clear to me to delete the option rather than setting it to null.
|
@iandunn Thank you for your suggestions for improvement :) |
Fixed #51884
Trac ticket: https://core.trac.wordpress.org/ticket/51884