diff --git a/assets/js/um-modal.js b/assets/js/um-modal.js index 99c117b2..f1a480c9 100644 --- a/assets/js/um-modal.js +++ b/assets/js/um-modal.js @@ -30,9 +30,10 @@ jQuery(document).ready(function() { um_modal_responsive(); jQuery.ajax({ - url: um_scripts.remove_file, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_remove_file', src: src } }); @@ -59,9 +60,10 @@ jQuery(document).ready(function() { um_modal_responsive(); jQuery.ajax({ - url: um_scripts.remove_file, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_remove_file', src: src } }); @@ -105,10 +107,11 @@ jQuery(document).ready(function() { jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled'); jQuery.ajax({ - url: um_scripts.resize_image, + url: wp.ajax.settings.url, type: 'POST', dataType: 'json', data: { + action: 'um_resize_image', src : src, coord : coord, user_id : user_id, diff --git a/assets/js/um-profile.js b/assets/js/um-profile.js index 624639cb..cdc5145b 100644 --- a/assets/js/um-profile.js +++ b/assets/js/um-profile.js @@ -43,9 +43,10 @@ jQuery(document).ready(function() { metakey = 'profile_photo'; jQuery.ajax({ - url: um_scripts.delete_profile_photo, + url: wp.ajax.settings.url, type: 'post', data: { + action:'um_delete_profile_photo', metakey: metakey, user_id: user_id } @@ -65,9 +66,10 @@ jQuery(document).ready(function() { metakey = 'cover_photo'; jQuery.ajax({ - url: um_scripts.delete_cover_photo, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_delete_cover_photo', metakey: metakey, user_id: user_id }, diff --git a/assets/js/um-scripts.js b/assets/js/um-scripts.js index f3132f48..539411d7 100644 --- a/assets/js/um-scripts.js +++ b/assets/js/um-scripts.js @@ -151,9 +151,10 @@ jQuery(document).ready(function() { parent.find('input[type=hidden]').val('empty_file'); jQuery.ajax({ - url: um_scripts.remove_file, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_remove_file', src: src } }); @@ -170,9 +171,10 @@ jQuery(document).ready(function() { parent.find('input[type=hidden]').val('empty_file'); jQuery.ajax({ - url: um_scripts.remove_file, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_remove_file', src: src } }); @@ -247,9 +249,10 @@ jQuery(document).ready(function() { var hook = jQuery(this).data('hook'); var container = jQuery(this).parents('.um').find('.um-ajax-items'); jQuery.ajax({ - url: um_scripts.ajax_paginate, + url: wp.ajax.settings.url, type: 'post', data: { + action: 'um_ajax_paginate', hook: hook, args: args }, diff --git a/includes/admin/core/packages/2.0.24/functions.php b/includes/admin/core/packages/2.0.24/functions.php new file mode 100644 index 00000000..083186a1 --- /dev/null +++ b/includes/admin/core/packages/2.0.24/functions.php @@ -0,0 +1,29 @@ +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 + 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.24' ); + + wp_send_json_success( array( 'message' => __( 'Privacy Settings was upgraded successfully', 'ultimate-member' ) ) ); +} \ No newline at end of file diff --git a/includes/admin/core/packages/2.0.24/hooks.php b/includes/admin/core/packages/2.0.24/hooks.php new file mode 100644 index 00000000..307a16ca --- /dev/null +++ b/includes/admin/core/packages/2.0.24/hooks.php @@ -0,0 +1,5 @@ + 'privacy2024', +); \ No newline at end of file diff --git a/includes/admin/core/packages/2.0.24/init.php b/includes/admin/core/packages/2.0.24/init.php new file mode 100644 index 00000000..ccf01dba --- /dev/null +++ b/includes/admin/core/packages/2.0.24/init.php @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/includes/core/class-ajax-common.php b/includes/core/class-ajax-common.php index f71f6093..2563d215 100644 --- a/includes/core/class-ajax-common.php +++ b/includes/core/class-ajax-common.php @@ -32,15 +32,14 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) { } - - add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) ); add_action( 'wp_ajax_um_delete_profile_photo', array( UM()->profile(), 'ajax_delete_profile_photo' ) ); add_action( 'wp_ajax_um_delete_cover_photo', array( UM()->profile(), 'ajax_delete_cover_photo' ) ); add_action( 'wp_ajax_um_select_options', array( UM()->form(), 'ajax_select_options' ) ); add_action( 'wp_ajax_um_ajax_paginate', array( UM()->query(), 'ajax_paginate' ) ); add_action( 'wp_ajax_um_muted_action', array( UM()->form(), 'ajax_muted_action' ) ); + + add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) ); add_action( 'wp_ajax_nopriv_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) ); - add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) ); add_action( 'wp_ajax_nopriv_um_fileupload', array( UM()->files(), 'ajax_file_upload' ) ); add_action( 'wp_ajax_um_fileupload', array( UM()->files(), 'ajax_file_upload' ) ); diff --git a/includes/core/class-enqueue.php b/includes/core/class-enqueue.php index d2891525..f1a170d6 100644 --- a/includes/core/class-enqueue.php +++ b/includes/core/class-enqueue.php @@ -137,12 +137,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { */ $localize_data = apply_filters( 'um_enqueue_localize_data', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'remove_file' => UM()->get_ajax_route( 'um\core\Files', 'ajax_remove_file' ), - 'delete_profile_photo' => UM()->get_ajax_route( 'um\core\Profile', 'ajax_delete_profile_photo' ), - 'delete_cover_photo' => UM()->get_ajax_route( 'um\core\Profile', 'ajax_delete_cover_photo' ), - 'resize_image' => UM()->get_ajax_route( 'um\core\Files', 'ajax_resize_image' ), 'muted_action' => UM()->get_ajax_route( 'um\core\Form', 'ajax_muted_action' ), - 'ajax_paginate' => UM()->get_ajax_route( 'um\core\Query', 'ajax_paginate' ), 'ajax_select_options' => UM()->get_ajax_route( 'um\core\Form', 'ajax_select_options' ), ) );