mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-13 19:56:27 +09:00
Remove duplicated method 'convert_tags'
Replaced with um_convert_tags function
This commit is contained in:
@@ -149,7 +149,7 @@
|
||||
|
||||
um_fetch_user( um_get_requested_user() );
|
||||
|
||||
$content = $ultimatemember->mail->convert_tags( um_get_option('profile_desc') );
|
||||
$content = um_convert_tags( um_get_option('profile_desc') );
|
||||
$user_id = um_user('ID');
|
||||
$url = um_user_profile_url();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
um_fetch_user( um_get_requested_user() );
|
||||
|
||||
$profile_title = $ultimatemember->mail->convert_tags( $profile_title );
|
||||
$profile_title = um_convert_tags( $profile_title );
|
||||
|
||||
$title = $profile_title;
|
||||
|
||||
|
||||
+2
-60
@@ -67,7 +67,7 @@ class UM_Mail {
|
||||
$this->headers = 'From: '. um_get_option('mail_from') .' <'. um_get_option('mail_from_addr') .'>' . "\r\n";
|
||||
|
||||
$this->subject = um_get_option( $template . '_sub' );
|
||||
$this->subject = $this->convert_tags( $this->subject, $args );
|
||||
$this->subject = um_convert_tags( $this->subject, $args );
|
||||
|
||||
if ( isset( $args['admin'] ) || isset( $args['plain_text'] ) ) {
|
||||
$this->force_plain_text = 'forced';
|
||||
@@ -82,7 +82,7 @@ class UM_Mail {
|
||||
}
|
||||
|
||||
// Convert tags in body
|
||||
$this->message = $this->convert_tags( $this->message, $args );
|
||||
$this->message = um_convert_tags( $this->message, $args );
|
||||
|
||||
// Send mail
|
||||
wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
|
||||
@@ -106,63 +106,5 @@ class UM_Mail {
|
||||
return 'text/plain';
|
||||
}
|
||||
|
||||
/***
|
||||
*** @convert template tags in email template
|
||||
***/
|
||||
function convert_tags( $content, $args = array() ) {
|
||||
|
||||
$search = array(
|
||||
'{display_name}',
|
||||
'{first_name}',
|
||||
'{last_name}',
|
||||
'{gender}',
|
||||
'{username}',
|
||||
'{email}',
|
||||
'{password}',
|
||||
'{login_url}',
|
||||
'{site_name}',
|
||||
'{site_url}',
|
||||
'{account_activation_link}',
|
||||
'{password_reset_link}',
|
||||
'{admin_email}',
|
||||
'{user_profile_link}',
|
||||
'{user_account_link}',
|
||||
'{submitted_registration}',
|
||||
'{user_avatar_url}',
|
||||
);
|
||||
|
||||
$search = apply_filters('um_template_tags_patterns_hook', $search);
|
||||
|
||||
$replace = array(
|
||||
um_user('display_name'),
|
||||
um_user('first_name'),
|
||||
um_user('last_name'),
|
||||
um_user('gender'),
|
||||
um_user('user_login'),
|
||||
um_user('user_email'),
|
||||
um_user('_um_cool_but_hard_to_guess_plain_pw'),
|
||||
um_get_core_page('login'),
|
||||
um_get_option('site_name'),
|
||||
get_bloginfo('url'),
|
||||
um_user('account_activation_link'),
|
||||
um_user('password_reset_link'),
|
||||
um_admin_email(),
|
||||
um_user_profile_url(),
|
||||
um_get_core_page('account'),
|
||||
um_user_submitted_registration(),
|
||||
um_get_user_avatar_url(),
|
||||
);
|
||||
|
||||
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
|
||||
|
||||
$content = str_replace($search, $replace, $content);
|
||||
|
||||
if ( isset( $args['tags'] ) && isset( $args['tags_replace'] ) ) {
|
||||
$content = str_replace($args['tags'], $args['tags_replace'], $content);
|
||||
}
|
||||
|
||||
return $content;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user