- 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:
nikitozzzzzzz
2018-11-15 18:53:59 +02:00
parent 986b294aed
commit 819d5333db
12 changed files with 44 additions and 274 deletions
-36
View File
@@ -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
*