mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- transferring emails to UM2.0 logic;
- first install email notifications settings;
This commit is contained in:
@@ -158,9 +158,10 @@ if ( ! class_exists( 'Mail' ) ) {
|
||||
*
|
||||
* @access public
|
||||
* @param string $template_name
|
||||
* @param bool $html
|
||||
* @return string
|
||||
*/
|
||||
function template_in_theme( $template_name ) {
|
||||
function template_in_theme( $template_name, $html = false ) {
|
||||
//WPML compatibility and multilingual email templates
|
||||
$lang = get_locale();
|
||||
$arr_english_lang = array( 'en', 'en_US', 'en_NZ', 'en_ZA', 'en_AU', 'en_GB' );
|
||||
@@ -171,9 +172,11 @@ if ( ! class_exists( 'Mail' ) ) {
|
||||
$lang .= '/';
|
||||
}
|
||||
|
||||
$ext = ! $html ? '.php' : '.html';
|
||||
|
||||
// check if there is template at theme folder
|
||||
$template = locate_template( array(
|
||||
trailingslashit( 'ultimate-member/email' ) . $lang . $template_name . '.php'
|
||||
trailingslashit( 'ultimate-member/email' ) . $lang . $template_name . $ext
|
||||
) );
|
||||
|
||||
// Return what we found.
|
||||
@@ -187,17 +190,21 @@ if ( ! class_exists( 'Mail' ) ) {
|
||||
* @access public
|
||||
* @param string $location
|
||||
* @param string $template_name
|
||||
* @param bool $html
|
||||
* @return string
|
||||
*/
|
||||
function get_template_file( $location, $template_name ) {
|
||||
function get_template_file( $location, $template_name, $html = false ) {
|
||||
$template_path = '';
|
||||
|
||||
$ext = ! $html ? '.php' : '.html';
|
||||
|
||||
switch( $location ) {
|
||||
case 'theme':
|
||||
$template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' ) . $template_name . '.php';
|
||||
$template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' ) . $template_name . $ext;
|
||||
break;
|
||||
case 'plugin':
|
||||
$path = ! empty( $this->path_by_slug[ $template_name ] ) ? $this->path_by_slug[ $template_name ] : um_path . 'templates/email';
|
||||
$template_path = trailingslashit( $path ) . $template_name . '.php';
|
||||
$template_path = trailingslashit( $path ) . $template_name . $ext;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user