mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
General: Avoid unnecessary calls to update_user_option().
The `update_user_option()` function is a way to update a user meta value after adding a blog’s prefix to the beginning of the meta key. But when the fourth parameter is `true`, the behavior is exactly the same as calling `update_user_meta()` directly. This replaces all instances of `update_user_option()` when the fourth parameter is `true` in Core with a direct call to `update_user_meta()` to prevent an unnecessary call to `update_user_option()`. Props johnjamesjacoby, zkancs, obenland, desrosj. Fixes #43339. git-svn-id: https://develop.svn.wordpress.org/trunk@50981 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1789,7 +1789,7 @@ function wp_localize_community_events() {
|
||||
*/
|
||||
if ( $saved_ip_address && $current_ip_address && $current_ip_address !== $saved_ip_address ) {
|
||||
$saved_location['ip'] = $current_ip_address;
|
||||
update_user_option( $user_id, 'community-events-location', $saved_location, true );
|
||||
update_user_meta( $user_id, 'community-events-location', $saved_location );
|
||||
}
|
||||
|
||||
$events_client = new WP_Community_Events( $user_id, $saved_location );
|
||||
|
||||
Reference in New Issue
Block a user