mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
dfc6f876ac
- Added: `um_member_directory_get_members_allow` JS hook for 3rd-party integration with the member directory. You could use a time throttle until some data is loaded - Fixed: Upgrade process on websites where a hosting locks the frequent AJAX requests (added default JS throttle between requests)
58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php ?>
|
|
|
|
<script type="text/javascript">
|
|
jQuery( document ).ready( function() {
|
|
//upgrade styles
|
|
um_add_upgrade_log( '<?php echo esc_js( __( 'Upgrade Styles...', 'ultimate-member' ) ) ?>' );
|
|
|
|
jQuery.ajax({
|
|
url: wp.ajax.settings.url,
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
data: {
|
|
action: 'um_styles2010',
|
|
nonce: um_admin_scripts.nonce
|
|
},
|
|
success: function( response ) {
|
|
if ( typeof response.data != 'undefined' ) {
|
|
um_add_upgrade_log( response.data.message );
|
|
setTimeout( function () {
|
|
um_clear_cache2010();
|
|
}, um_request_throttle );
|
|
} else {
|
|
um_wrong_ajax();
|
|
}
|
|
},
|
|
error: function() {
|
|
um_something_wrong();
|
|
}
|
|
});
|
|
|
|
|
|
//clear users cache
|
|
function um_clear_cache2010() {
|
|
um_add_upgrade_log( '<?php echo esc_js( __( 'Clear Users Cache...', 'ultimate-member' ) ) ?>' );
|
|
jQuery.ajax({
|
|
url: wp.ajax.settings.url,
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
data: {
|
|
action: 'um_cache2010',
|
|
nonce: um_admin_scripts.nonce
|
|
},
|
|
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>
|