mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-20 15:13:55 +09:00
Merge remote-tracking branch 'remotes/origin/fix_reset_pass_hash_after_approve'
# Conflicts: # includes/um-short-functions.php
This commit is contained in:
@@ -85,6 +85,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'um_resend_activation':
|
case 'um_resend_activation':
|
||||||
|
|
||||||
|
add_filter( 'um_template_tags_patterns_hook', array( UM()->user(), 'add_activation_placeholder' ), 10, 1 );
|
||||||
|
add_filter( 'um_template_tags_replaces_hook', array( UM()->user(), 'add_activation_replace_placeholder' ), 10, 1 );
|
||||||
|
|
||||||
UM()->user()->email_pending();
|
UM()->user()->email_pending();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -1901,5 +1901,31 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
|||||||
|
|
||||||
return $hash_email_address;
|
return $hash_email_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UM Placeholders for activation link in email
|
||||||
|
*
|
||||||
|
* @param $placeholders
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function add_activation_placeholder( $placeholders ) {
|
||||||
|
$placeholders[] = '{account_activation_link}';
|
||||||
|
return $placeholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UM Replace Placeholders for activation link in email
|
||||||
|
*
|
||||||
|
* @param $replace_placeholders
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function add_activation_replace_placeholder( $replace_placeholders ) {
|
||||||
|
$replace_placeholders[] = um_user( 'account_activation_link' );
|
||||||
|
return $replace_placeholders;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,6 +123,9 @@ function um_action_request_process() {
|
|||||||
wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) );
|
wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_filter( 'um_template_tags_patterns_hook', array( UM()->user(), 'add_activation_placeholder' ), 10, 1 );
|
||||||
|
add_filter( 'um_template_tags_replaces_hook', array( UM()->user(), 'add_activation_replace_placeholder' ), 10, 1 );
|
||||||
|
|
||||||
um_fetch_user( $uid );
|
um_fetch_user( $uid );
|
||||||
UM()->user()->email_pending();
|
UM()->user()->email_pending();
|
||||||
exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) );
|
exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) );
|
||||||
|
|||||||
@@ -14,11 +14,19 @@ function um_dynamic_user_profile_pagetitle( $title, $sep = '' ) {
|
|||||||
|
|
||||||
$profile_title = UM()->options()->get( 'profile_title' );
|
$profile_title = UM()->options()->get( 'profile_title' );
|
||||||
|
|
||||||
if ( um_is_core_page('user') && um_get_requested_user() ) {
|
if ( um_is_core_page( 'user' ) && um_get_requested_user() ) {
|
||||||
|
|
||||||
um_fetch_user( um_get_requested_user() );
|
um_fetch_user( um_get_requested_user() );
|
||||||
|
|
||||||
$profile_title = um_convert_tags( $profile_title );
|
$search = array(
|
||||||
|
'{display_name}',
|
||||||
|
'{site_name}'
|
||||||
|
);
|
||||||
|
$replace = array(
|
||||||
|
um_user( 'display_name' ),
|
||||||
|
UM()->options()->get( 'site_name' )
|
||||||
|
);
|
||||||
|
$profile_title = str_replace( $search, $replace, $profile_title );
|
||||||
|
|
||||||
$title = $profile_title;
|
$title = $profile_title;
|
||||||
|
|
||||||
|
|||||||
@@ -132,20 +132,20 @@ function um_set_redirect_url( $url ) {
|
|||||||
*/
|
*/
|
||||||
function um_get_redirect_url( $key ) {
|
function um_get_redirect_url( $key ) {
|
||||||
|
|
||||||
if (um_is_session_started() === false) {
|
if ( um_is_session_started() === false ) {
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset( $_SESSION['um_redirect_key'][$key] )) {
|
if ( isset( $_SESSION['um_redirect_key'][ $key ] ) ) {
|
||||||
|
|
||||||
$url = $_SESSION['um_redirect_key'][$key];
|
$url = $_SESSION['um_redirect_key'][ $key ];
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (isset( $_SESSION['um_redirect_key'] )) {
|
if ( isset( $_SESSION['um_redirect_key'] ) ) {
|
||||||
foreach ($_SESSION['um_redirect_key'] as $key => $url) {
|
foreach ( $_SESSION['um_redirect_key'] as $key => $url ) {
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
|
||||||
|
|||||||
@@ -103,15 +103,11 @@ function um_clean_user_basename( $value ) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert template tags
|
* Getting replace placeholders array
|
||||||
*
|
*
|
||||||
* @param $content
|
* @return array
|
||||||
* @param array $args
|
|
||||||
* @param bool $with_kses
|
|
||||||
*
|
|
||||||
* @return mixed|string
|
|
||||||
*/
|
*/
|
||||||
function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
function um_replace_placeholders() {
|
||||||
$search = array(
|
$search = array(
|
||||||
'{display_name}',
|
'{display_name}',
|
||||||
'{first_name}',
|
'{first_name}',
|
||||||
@@ -124,7 +120,6 @@ function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
|||||||
'{login_referrer}',
|
'{login_referrer}',
|
||||||
'{site_name}',
|
'{site_name}',
|
||||||
'{site_url}',
|
'{site_url}',
|
||||||
'{account_activation_link}',
|
|
||||||
'{admin_email}',
|
'{admin_email}',
|
||||||
'{user_profile_link}',
|
'{user_profile_link}',
|
||||||
'{user_account_link}',
|
'{user_account_link}',
|
||||||
@@ -167,7 +162,6 @@ function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
|||||||
um_dynamic_login_page_redirect(),
|
um_dynamic_login_page_redirect(),
|
||||||
UM()->options()->get( 'site_name' ),
|
UM()->options()->get( 'site_name' ),
|
||||||
get_bloginfo( 'url' ),
|
get_bloginfo( 'url' ),
|
||||||
um_user( 'account_activation_link' ),
|
|
||||||
um_admin_email(),
|
um_admin_email(),
|
||||||
um_user_profile_url(),
|
um_user_profile_url(),
|
||||||
um_get_core_page( 'account' ),
|
um_get_core_page( 'account' ),
|
||||||
@@ -198,7 +192,23 @@ function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
|||||||
*/
|
*/
|
||||||
$replace = apply_filters( 'um_template_tags_replaces_hook', $replace );
|
$replace = apply_filters( 'um_template_tags_replaces_hook', $replace );
|
||||||
|
|
||||||
$content = str_replace( $search, $replace, $content );
|
return array_combine( $search, $replace );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert template tags
|
||||||
|
*
|
||||||
|
* @param $content
|
||||||
|
* @param array $args
|
||||||
|
* @param bool $with_kses
|
||||||
|
*
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
|
function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
||||||
|
$placeholders = um_replace_placeholders();
|
||||||
|
|
||||||
|
$content = str_replace( array_keys( $placeholders ), array_values( $placeholders ), $content );
|
||||||
if ( $with_kses ) {
|
if ( $with_kses ) {
|
||||||
$content = wp_kses_decode_entities( $content );
|
$content = wp_kses_decode_entities( $content );
|
||||||
}
|
}
|
||||||
@@ -221,6 +231,31 @@ function um_convert_tags( $content, $args = array(), $with_kses = true ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UM Placeholders for activation link in email
|
||||||
|
*
|
||||||
|
* @param $placeholders
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function account_activation_link_tags_patterns( $placeholders ) {
|
||||||
|
$placeholders[] = '{account_activation_link}';
|
||||||
|
return $placeholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UM Replace Placeholders for activation link in email
|
||||||
|
*
|
||||||
|
* @param $replace_placeholders
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function account_activation_link_tags_replaces( $replace_placeholders ) {
|
||||||
|
$replace_placeholders[] = um_user( 'account_activation_link' );
|
||||||
|
return $replace_placeholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function um_user_ip()
|
* @function um_user_ip()
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user