mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- small code formatting changes;
This commit is contained in:
@@ -194,62 +194,4 @@ if ( is_multisite() ) {
|
||||
restore_current_blog();
|
||||
} else {
|
||||
um_upgrade20beta1_email_templates_process();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Transferring email templates to new logic
|
||||
*/
|
||||
/*$templates_in_theme = 0;
|
||||
$emails = UM()->config()->email_notifications;
|
||||
foreach ( $emails as $email_key => $value ) {
|
||||
|
||||
$in_theme = um_upgrade20beta1_template_in_theme( $email_key, true );
|
||||
$theme_template_path = um_upgrade20beta1_get_template_file( 'theme', $email_key );
|
||||
|
||||
if ( ! $in_theme ) {
|
||||
//there isn't HTML email template's file in theme, get from option
|
||||
//this value is correct for each multisite's subsites
|
||||
$setting_value = UM()->options()->get( $email_key );
|
||||
|
||||
$html_email = UM()->options()->get( 'email_html' );
|
||||
if ( $html_email ) {
|
||||
|
||||
if ( ! um_upgrade20beta1_copy_email_template( $email_key ) ) {
|
||||
|
||||
um_upgrade20beta1_insert_content( $theme_template_path, $setting_value );
|
||||
|
||||
} else {
|
||||
|
||||
$templates_in_theme++;
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
um_upgrade20beta1_insert_content( $theme_template_path, $setting_value );
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
//there is HTML email template in a theme's folder
|
||||
$theme_template_path_html = um_upgrade20beta1_get_template_file( 'theme', $email_key, true );
|
||||
|
||||
$setting_value = preg_replace( '/<\/body>|<\/head>|<html>|<\/html>|<body.*?>|<head.*?>/' , '', file_get_contents( $theme_template_path_html ) );
|
||||
|
||||
if ( file_exists( $theme_template_path_html ) ) {
|
||||
|
||||
if ( copy( $theme_template_path_html, $theme_template_path ) ) {
|
||||
|
||||
um_upgrade20beta1_insert_content( $theme_template_path, $setting_value );
|
||||
|
||||
$templates_in_theme++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$email_html = ( $templates_in_theme > 0 ) ? true : false;
|
||||
UM()->options()->update( 'email_html', $email_html );*/
|
||||
}
|
||||
Reference in New Issue
Block a user