mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- notices texts changes;
- remove language notice; - fixed duplicated "redirect_to" field; - added compatibility with PHP7.2 (removed deprecated functions and ini variables);
This commit is contained in:
@@ -37,7 +37,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
add_action( 'um_admin_do_action__purge_temp', array( &$this, 'purge_temp' ) );
|
||||
add_action( 'um_admin_do_action__manual_upgrades_request', array( &$this, 'manual_upgrades_request' ) );
|
||||
add_action( 'um_admin_do_action__duplicate_form', array( &$this, 'duplicate_form' ) );
|
||||
add_action( 'um_admin_do_action__um_language_downloader', array( &$this, 'um_language_downloader' ) );
|
||||
add_action( 'um_admin_do_action__um_hide_locale_notice', array( &$this, 'um_hide_notice' ) );
|
||||
add_action( 'um_admin_do_action__um_can_register_notice', array( &$this, 'um_hide_notice' ) );
|
||||
add_action( 'um_admin_do_action__um_hide_exif_notice', array( &$this, 'um_hide_notice' ) );
|
||||
@@ -209,41 +208,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download a language remotely
|
||||
*
|
||||
* @param $action
|
||||
*/
|
||||
function um_language_downloader( $action ) {
|
||||
if ( !is_admin() || !current_user_can('manage_options') ) die();
|
||||
|
||||
$locale = get_option('WPLANG');
|
||||
if ( !$locale ) return;
|
||||
if ( !isset( UM()->available_languages[$locale] ) ) return;
|
||||
|
||||
$path = UM()->files()->upload_basedir;
|
||||
$path = str_replace('/uploads/ultimatemember','',$path);
|
||||
$path = $path . '/languages/plugins/';
|
||||
$path = str_replace('//','/',$path);
|
||||
|
||||
$remote = 'https://ultimatemember.com/wp-content/languages/plugins/ultimatemember-' . $locale . '.po';
|
||||
$remote2 = 'https://ultimatemember.com/wp-content/languages/plugins/ultimatemember-' . $locale . '.mo';
|
||||
|
||||
$remote_tmp = download_url( $remote, $timeout = 300 );
|
||||
copy( $remote_tmp, $path . 'ultimatemember-' . $locale . '.po' );
|
||||
unlink( $remote_tmp );
|
||||
|
||||
$remote2_tmp = download_url( $remote2, $timeout = 300 );
|
||||
copy( $remote2_tmp, $path . 'ultimatemember-' . $locale . '.mo' );
|
||||
unlink( $remote2_tmp );
|
||||
|
||||
$url = remove_query_arg('um_adm_action', UM()->permalinks()->get_current_url() );
|
||||
$url = add_query_arg('update','language_updated',$url);
|
||||
exit( wp_redirect($url) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action to hide notices in admin
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user