Skip to content

Wordpress 51884 - #844

Open
Yeora wants to merge 18 commits into
WordPress:masterfrom
Yeora:WORDPRESS-51884
Open

Yeora wants to merge 18 commits into
WordPress:masterfrom
Yeora:WORDPRESS-51884

Conversation

@Yeora

@Yeora Yeora commented Dec 28, 2020

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Hi @Yeora! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

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,
The WordPress Project

@iandunn iandunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be the 3rd place the above code is duplicated. It'd be nice to create a getRequestParams() function to keep it DRY.

Comment thread src/wp-admin/includes/ajax-actions.php Outdated
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 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit more clear to me to delete the option rather than setting it to null.

@Yeora

Yeora commented Jan 9, 2021

Copy link
Copy Markdown
Author

@iandunn Thank you for your suggestions for improvement :)

@sarimarockey

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants