mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- release 2.0.23
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
function um_upgrade_privacy2023() {
|
||||
um_maybe_unset_time_limit();
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query( $wpdb->prepare(
|
||||
"UPDATE {$wpdb->usermeta}
|
||||
SET meta_value = CASE
|
||||
WHEN meta_value = %s THEN 'Everyone'
|
||||
WHEN meta_value = %s THEN 'Only me'
|
||||
WHEN meta_value = %s THEN 'followed'
|
||||
WHEN meta_value = %s THEN 'follower'
|
||||
WHEN meta_value = %s THEN 'friends'
|
||||
END CASE
|
||||
WHERE meta_key = 'profile_privacy'",
|
||||
__( 'Everyone', 'ultimate-member' ),
|
||||
__( 'Only me', 'ultimate-member' ),
|
||||
__( 'Only people I follow can view my profile', 'um-followers' ),
|
||||
__( 'Followers', 'um-followers' ),
|
||||
__( 'Friends only', 'um-friends' )
|
||||
) );
|
||||
|
||||
UM()->user()->remove_cache_all_users();
|
||||
|
||||
update_option( 'um_last_version_upgrade', '2.0.23' );
|
||||
|
||||
wp_send_json_success( array( 'message' => __( 'Privacy Settings was upgraded successfully', 'ultimate-member' ) ) );
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'privacy2023' => 'privacy2023',
|
||||
);
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
<?php ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery( document ).ready( function() {
|
||||
//upgrade styles
|
||||
um_add_upgrade_log( '<?php echo esc_js( __( 'Upgrade Privacy Settings...', 'ultimate-member' ) ) ?>' );
|
||||
|
||||
jQuery.ajax({
|
||||
url: '<?php echo admin_url( 'admin-ajax.php' ) ?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 'um_privacy2023'
|
||||
},
|
||||
success: function( response ) {
|
||||
if ( typeof response.data != 'undefined' ) {
|
||||
um_add_upgrade_log( response.data.message );
|
||||
//switch to the next package
|
||||
um_run_upgrade();
|
||||
} else {
|
||||
um_wrong_ajax();
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
um_something_wrong();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user