- fixed redirect after registration;

- removed empty set_roles() function;
- added function for checking AMP;
This commit is contained in:
nikitasinelnikov
2020-10-02 15:48:59 +03:00
parent 042be3351a
commit e26a6a33ab
5 changed files with 34 additions and 14 deletions
@@ -345,18 +345,6 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) {
}
/**
* Set roles to user (remove all previous roles)
* make user only with $roles roles
*
* @param int $user_id
* @param string|array $roles
*/
function set_roles( $user_id, $roles ) {
}
/**
* Get user one of UM roles if it has it
*
+1 -1
View File
@@ -564,7 +564,7 @@ add_filter( 'um_before_save_filter_submitted', array( UM()->validation(), 'valid
* @param $to_update
*/
function um_restore_default_roles( $user_id, $args, $to_update ) {
if ( ! empty( $args['submitted']['role'] ) ) {
if ( ! empty( $args['submitted']['role'] ) && ! empty( $to_update['role'] ) ) {
$wp_user = new WP_User( $user_id );
$role_keys = array_map( function( $item ) {
+2
View File
@@ -206,6 +206,8 @@ function um_check_user_status( $user_id, $args ) {
exit( wp_safe_redirect( urldecode( $args['redirect_to'] ) ) );
}
um_fetch_user( $user_id );
if ( um_user( 'auto_approve_act' ) == 'redirect_url' && um_user( 'auto_approve_url' ) !== '' ) {
exit( wp_redirect( um_user( 'auto_approve_url' ) ) );
}
+30
View File
@@ -2770,4 +2770,34 @@ if ( ! function_exists( 'um_is_profile_owner' ) ) {
return ( $user_id == um_profile_id() );
}
}
/**
* Check whether the current page is in AMP mode or not.
* We need to check for specific functions, as there is no special AMP header.
*
* @since 2.1.11
*
* @param bool $check_theme_support Whether theme support should be checked. Defaults to true.
*
* @uses is_amp_endpoint() AMP by Automattic
* @uses is_better_amp() Better AMP
*
* @return bool
*/
function um_is_amp( $check_theme_support = true ) {
$is_amp = false;
if ( ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) ||
( function_exists( 'is_better_amp' ) && is_better_amp() ) ) {
$is_amp = true;
}
if ( $is_amp && $check_theme_support ) {
$is_amp = current_theme_supports( 'amp' );
}
return apply_filters( 'um_is_amp', $is_amp );
}
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
Version: 2.1.11-rc.2
Version: 2.1.11-rc.1
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member