Update/sync user language choice#6053
Merged
samhotchkiss merged 7 commits intomasterfrom Mar 13, 2017
Merged
Conversation
ebinnion
reviewed
Jan 9, 2017
| $this->server_replica_storage->reset(); | ||
| $this->sender->reset_data(); | ||
|
|
||
Contributor
There was a problem hiding this comment.
There's extra whitespace here.
ebinnion
reviewed
Jan 9, 2017
| public function test_delete_user_locale_is_synced() { | ||
| global $wp_version; | ||
| if ( version_compare( $wp_version, 4.7, '<' ) ) { | ||
| $this->markTestSkipped( 'WP 4.7 and up supports user local' ); |
ebinnion
reviewed
Jan 9, 2017
| return $user; | ||
| } | ||
|
|
||
| // Only set the user local if it is different from the site local |
Contributor
There was a problem hiding this comment.
It might be a bit easier to write this as:
public function add_to_user( $user ) {
$user->allowed_mime_types = get_allowed_mime_types( $user );
if ( ! function_exists( 'get_user_locale' ) ) {
return $user;
}
// Only set the user local if it is different from the site local
if ( get_locale() !== get_user_locale( $user->ID ) ) {
$user->locale = get_user_locale( $user->ID );
}
return $user;
}In case we need to add more meta in the future.
Contributor
|
I left a bit of minor feedback, but overall, this LGTM. 👍 |
lezama
reviewed
Jan 15, 2017
|
|
||
| return $user; | ||
|
|
||
| return $user; |
eab9ae9 to
f4cbc0d
Compare
Member
Author
lezama
reviewed
Feb 1, 2017
lezama
reviewed
Feb 1, 2017
Contributor
There was a problem hiding this comment.
I think it would be cleaner if we sync a jetpack_sync_delete_user_locale?
lezama
reviewed
Feb 1, 2017
Member
Author
|
@lezama Added fixes as per your suggestions. |
5b91254 to
14c2331
Compare
jeherve
previously requested changes
Feb 27, 2017
| function maybe_save_user_meta( $meta_id, $user_id, $meta_key, $value ) { | ||
| if ( $meta_key === 'locale' ) { | ||
| if ( current_filter() === 'deleted_user_meta' ) { | ||
| do_action( 'jetpack_sync_user_locale_delete', $user_id ); |
| if ( current_filter() === 'deleted_user_meta' ) { | ||
| do_action( 'jetpack_sync_user_locale_delete', $user_id ); | ||
| } else { | ||
| do_action( 'jetpack_sync_user_locale', $user_id, $value ); |
be08830 to
c56fa87
Compare
Sync the user locale value so that we have a better idea what need the user like the interface in.
Sync the user local when doing full sync.
c56fa87 to
18f4029
Compare
samhotchkiss
pushed a commit
that referenced
this pull request
Mar 29, 2017
* Readme: remove old release and add skeleton for 4.8. * Changelog: add #6572 * Changelog: add #6567 * Changelog: add #6542 * Changelog: add #6527 * Changelog: add #6508 * Changelog: add #6478 * Changelog: add #6477 * Changelog: add #6249 * Update stable version and remove old version from readme. * Changelog: add 4.7.1 to changelog. * Readme: add new contributor. * Sync: update docblock @SInCE version. Related: #6053 * Changelog: add release post. * changelog: add #6053 * Changelog: add #6413 * Changelog: add #6482 * Changelog: add #6584 * Changelog add #6603 * Changelog: add #6606 * Changelog: add #6611 * Changelog: add #6635 * Changelog: add #6639 * Changelog: add #6684 * Changelog: add #6710 * Changelog: add #6711 * Changelog: add #5461 * Testing list: update Settings UI feedback prompt. Props @MichaelArestad * Changelog: add #6789 * Changelog: add #6778 * Changelog: add #6777 * Changelog: add #6775 * Changelog: add #6755 * Changelog: add #6731 * Changelog: add #6721 * Changelog: add #6705 * Changelog: add #6702 * Changelog: add #6671 * Changelog: add #6637 * Changelog: add #6582 * Changelog: add #6566 * Changelog: add #6555 * Changelog: add #6529 * Changelog: add #6344 * Changelog: add #5763 * Changelog: add #5503 * Changelog: update #6637 changelog. @see 40e115c#commitcomment-21523982 * Changelog: add #6699 * Changelog: add #6632 * Changelog: add #6769 * Changelog: add #6707 * Changelog: add #6590
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5535
Sync the user local if it is different from the sites or if the user sets it.
Changes proposed in this Pull Request:
Add sync event when the user local changes.
Full Sync doesn't send user local if it is the same as the sites.
Testing instructions:
Proposed changelog entry for your changes:
gulp js:hintbefore to commit your changes. It will allow you to detect errors in Javascript files.