mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Merge branch 'master' of https://github.com/ultimatemember/ultimatemember into fix/ms_email_templates
This commit is contained in:
@@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl
|
||||
|
||||
| Latest Version |Requires at least|Stable Tag|
|
||||
| :------------: |:------------:|:------------:|
|
||||
| 2.0.16 | WordPress 4.9 or higher| 2.0.16 |
|
||||
| 2.0.17 | WordPress 4.9 or higher| 2.0.17 |
|
||||
|
||||
|
||||
Features of the plugin include:
|
||||
@@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version
|
||||
|
||||
Releases
|
||||
====================
|
||||
[Official Release Version: 2.0.16](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.16).
|
||||
[Official Release Version: 2.0.17](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.17).
|
||||
|
||||
[Official Release Version: 1.3.88](https://github.com/ultimatemember/ultimatemember/releases).
|
||||
|
||||
|
||||
@@ -393,13 +393,31 @@ font-weight: normal;
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.um-profile-nav-item.without-icon a {padding-left: 10px}
|
||||
.um-profile-nav-item.without-icon span.title {padding-left: 0}
|
||||
.um-profile-nav-item.without-icon i {display: none}
|
||||
.um-profile-nav-item.without-icon a {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.um-profile-nav-item.without-icon span.title {
|
||||
padding-left: 0;
|
||||
}
|
||||
.um-profile-nav-item.without-icon i {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.um-profile-nav-item a:hover {background: #555}
|
||||
.um-profile-nav-item i {font-size: 18px;height: 18px;line-height: 18px;position: absolute;display: block;top: 8px;left: 10px}
|
||||
.um-profile-nav-item span.title {padding-left: 5px}
|
||||
.um-profile-nav-item a:hover {
|
||||
background: #555;
|
||||
}
|
||||
.um-profile-nav-item i {
|
||||
font-size: 18px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 8px;
|
||||
left: 10px;
|
||||
}
|
||||
.um-profile-nav-item span.title {
|
||||
padding-left: 5px;
|
||||
}
|
||||
.um-profile-nav-item span.count {
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
|
||||
@@ -35,6 +35,7 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
|
||||
add_action( 'um_admin_do_action__user_cache', array( &$this, 'user_cache' ) );
|
||||
add_action( 'um_admin_do_action__purge_temp', array( &$this, 'purge_temp' ) );
|
||||
add_action( 'um_admin_do_action__manual_upgrades_request', array( &$this, 'manual_upgrades_request' ) );
|
||||
add_action( 'um_admin_do_action__duplicate_form', array( &$this, 'duplicate_form' ) );
|
||||
add_action( 'um_admin_do_action__um_language_downloader', array( &$this, 'um_language_downloader' ) );
|
||||
add_action( 'um_admin_do_action__um_hide_locale_notice', array( &$this, 'um_hide_notice' ) );
|
||||
@@ -48,6 +49,29 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
}
|
||||
|
||||
|
||||
function manual_upgrades_request() {
|
||||
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
$last_request = get_option( 'um_last_manual_upgrades_request', false );
|
||||
|
||||
if ( empty( $last_request ) || time() > $last_request + DAY_IN_SECONDS ) {
|
||||
|
||||
delete_transient( 'update_plugins' );
|
||||
delete_site_transient( 'update_plugins' );
|
||||
|
||||
UM()->plugin_updater()->um_checklicenses();
|
||||
|
||||
update_option( 'um_last_manual_upgrades_request', time() );
|
||||
|
||||
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'got_updates' ), admin_url( 'admin.php' ) );
|
||||
} else {
|
||||
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'often_updates' ), admin_url( 'admin.php' ) );
|
||||
}
|
||||
exit( wp_redirect( $url ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear all users cache
|
||||
|
||||
@@ -206,6 +206,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
|
||||
add_meta_box( 'um-metaboxes-mainbox-1', __( 'Latest from our blog', 'ultimate-member' ), array( &$this, 'um_news' ), $this->pagehook, 'normal', 'core' );
|
||||
|
||||
add_meta_box( 'um-metaboxes-sidebox-1', __( 'Purge Temp Files', 'ultimate-member' ), array( &$this, 'purge_temp' ), $this->pagehook, 'side', 'core' );
|
||||
|
||||
add_meta_box( 'um-metaboxes-sidebox-2', __( 'User Cache', 'ultimate-member' ), array( &$this, 'user_cache' ), $this->pagehook, 'side', 'core' );
|
||||
|
||||
if ( $this->language_avaialable_not_installed() ) {
|
||||
@@ -215,6 +216,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
|
||||
} else if ( $this->language_not_available() ) {
|
||||
add_meta_box( 'um-metaboxes-sidebox-2', __( 'Language', 'ultimate-member' ), array( &$this, 'ct_language' ), $this->pagehook, 'side', 'core' );
|
||||
}
|
||||
|
||||
//If there are active and licensed extensions - show metabox for upgrade it
|
||||
$exts = UM()->plugin_updater()->um_get_active_plugins();
|
||||
if ( 0 < count( $exts ) ) {
|
||||
add_meta_box( 'um-metaboxes-sidebox-3', __( 'Upgrade\'s Manual Request', 'ultimate-member' ), array( &$this, 'upgrade_request' ), $this->pagehook, 'side', 'core' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -269,6 +276,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function upgrade_request() {
|
||||
include_once UM()->admin()->templates_path . 'dashboard/upgrade-request.php';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -420,6 +420,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
|
||||
$messages[0]['content'] = __( 'Your user cache is now removed.', 'ultimate-member' );
|
||||
break;
|
||||
|
||||
case 'got_updates':
|
||||
$messages[0]['content'] = __( 'You got the latest upgrades.', 'ultimate-member' );
|
||||
break;
|
||||
|
||||
case 'often_updates':
|
||||
$messages[0]['err_content'] = __( 'Try again later. You can run this action once daily.', 'ultimate-member' );
|
||||
break;
|
||||
|
||||
case 'form_duplicated':
|
||||
$messages[0]['content'] = __( 'The form has been duplicated successfully.', 'ultimate-member' );
|
||||
break;
|
||||
|
||||
@@ -17,6 +17,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
class Admin_Upgrade {
|
||||
|
||||
|
||||
/**
|
||||
* @var null
|
||||
*/
|
||||
protected static $instance = null;
|
||||
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
@@ -31,6 +37,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
var $packages_dir;
|
||||
|
||||
|
||||
/**
|
||||
* Main Admin_Upgrade Instance
|
||||
*
|
||||
* Ensures only one instance of UM is loaded or can be loaded.
|
||||
*
|
||||
* @since 1.0
|
||||
* @static
|
||||
* @see UM()
|
||||
* @return Admin_Upgrade - Main instance
|
||||
*/
|
||||
static public function instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Admin_Upgrade constructor.
|
||||
*/
|
||||
@@ -39,11 +64,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
$this->necessary_packages = $this->need_run_upgrades();
|
||||
|
||||
if ( ! empty( $this->necessary_packages ) ) {
|
||||
$this->init_packages_ajax();
|
||||
add_action( 'admin_menu', array( $this, 'admin_menu' ), 0 );
|
||||
|
||||
add_action( 'wp_ajax_um_run_package', array( $this, 'ajax_run_package' ) );
|
||||
add_action( 'wp_ajax_um_get_packages', array( $this, 'ajax_get_packages' ) );
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||
$this->init_packages_ajax();
|
||||
|
||||
add_action( 'wp_ajax_um_run_package', array( $this, 'ajax_run_package' ) );
|
||||
add_action( 'wp_ajax_um_get_packages', array( $this, 'ajax_get_packages' ) );
|
||||
}
|
||||
}
|
||||
|
||||
//add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
|
||||
@@ -143,7 +171,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
foreach ( $this->necessary_packages as $package ) {
|
||||
$hooks_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'hooks.php';
|
||||
if ( file_exists( $hooks_file ) ) {
|
||||
$pack_ajax_hooks = include $hooks_file;
|
||||
$pack_ajax_hooks = include_once $hooks_file;
|
||||
|
||||
foreach ( $pack_ajax_hooks as $action => $function ) {
|
||||
add_action( 'wp_ajax_um_' . $action, "um_upgrade_$function" );
|
||||
@@ -160,7 +188,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
foreach ( $this->necessary_packages as $package ) {
|
||||
$handlers_file = $this->packages_dir . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'functions.php';
|
||||
if ( file_exists( $handlers_file ) ) {
|
||||
include $handlers_file;
|
||||
include_once $handlers_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,7 +318,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
|
||||
exit('');
|
||||
} else {
|
||||
ob_start();
|
||||
include $this->packages_dir . DIRECTORY_SEPARATOR . $_POST['pack'] . DIRECTORY_SEPARATOR . 'init.php';
|
||||
include_once $this->packages_dir . DIRECTORY_SEPARATOR . $_POST['pack'] . DIRECTORY_SEPARATOR . 'init.php';
|
||||
ob_get_flush();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ foreach ( $emails as $email_key => $value ) {
|
||||
} else {
|
||||
$setting_value = UM()->options()->get( $email_key );
|
||||
|
||||
$fp = fopen( $theme_template_path, "w" );
|
||||
$result = fputs( $fp, $setting_value );
|
||||
$fp = @fopen( $theme_template_path, "w" );
|
||||
$result = @fputs( $fp, $setting_value );
|
||||
fclose( $fp );
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<p><?php _e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ) ?></p>
|
||||
<p>
|
||||
<a href="<?php echo add_query_arg( 'um_adm_action', 'manual_upgrades_request' ); ?>" class="button">
|
||||
<?php _e( 'Get latest versions', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
</p>
|
||||
@@ -637,7 +637,8 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
*/
|
||||
function admin_upgrade() {
|
||||
if ( empty( $this->classes['admin_upgrade'] ) ) {
|
||||
$this->classes['admin_upgrade'] = new um\admin\core\Admin_Upgrade();
|
||||
$this->classes['admin_upgrade'] = um\admin\core\Admin_Upgrade::instance();
|
||||
//$this->classes['admin_upgrade'] = new um\admin\core\Admin_Upgrade();
|
||||
}
|
||||
return $this->classes['admin_upgrade'];
|
||||
}
|
||||
|
||||
@@ -751,7 +751,6 @@ if ( ! class_exists( 'um\core\Account' ) ) {
|
||||
* ?>
|
||||
*/
|
||||
do_action( "um_after_account_{$tab_id}", $args );
|
||||
// var_dump($args);
|
||||
|
||||
if ( ! isset( $tab_data['show_button'] ) || false !== $tab_data['show_button'] ) { ?>
|
||||
|
||||
|
||||
@@ -2890,7 +2890,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$um_field_checkbox_item_title = $v;
|
||||
$option_value = $v;
|
||||
|
||||
if (!is_numeric( $k ) && in_array( $form_key, array( 'role' ) )) {
|
||||
if ( ! is_numeric( $k ) && in_array( $form_key, array( 'role', 'role_radio' ) ) ) {
|
||||
$um_field_checkbox_item_title = $v;
|
||||
$option_value = $k;
|
||||
}
|
||||
|
||||
@@ -465,8 +465,9 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
$global_role = get_option( 'default_role' ); // WP Global settings
|
||||
|
||||
$um_global_role = UM()->options()->get( 'register_role' ); // UM Settings Global settings
|
||||
if ( ! empty( $um_global_role ) )
|
||||
if ( ! empty( $um_global_role ) ) {
|
||||
$global_role = $um_global_role; // Form Global settings
|
||||
}
|
||||
|
||||
|
||||
$mode = $this->form_type( $post_id );
|
||||
|
||||
@@ -124,10 +124,14 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
|
||||
|
||||
$this->message = $this->prepare_template( $template, $args );
|
||||
|
||||
add_filter( 'wp_mail_content_type', array( &$this, 'set_content_type' ) );
|
||||
if ( UM()->options()->get( 'email_html' ) ) {
|
||||
$this->headers .= "Content-Type: text/html\r\n";
|
||||
} else {
|
||||
$this->headers .= "Content-Type: text/plain\r\n";
|
||||
}
|
||||
|
||||
// Send mail
|
||||
wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
|
||||
remove_filter( 'wp_mail_content_type', array( &$this, 'set_content_type' ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -481,22 +485,6 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set email content type
|
||||
*
|
||||
*
|
||||
* @param $content_type
|
||||
* @return string
|
||||
*/
|
||||
function set_content_type( $content_type ) {
|
||||
if ( UM()->options()->get( 'email_html' ) ) {
|
||||
return 'text/html';
|
||||
} else {
|
||||
return 'text/plain';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ajax copy template to the theme
|
||||
*
|
||||
|
||||
@@ -1661,23 +1661,29 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update user
|
||||
if ( count( $args ) > 1 ) {
|
||||
global $wp_roles;
|
||||
$um_roles = get_option( 'um_roles' );
|
||||
|
||||
if ( ! empty( $um_roles ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, get_option( 'um_roles' ) );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
}
|
||||
//if isset roles argument validate role to properly for security reasons
|
||||
if ( isset( $args['role'] ) ) {
|
||||
global $wp_roles;
|
||||
$um_roles = get_option( 'um_roles' );
|
||||
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
if ( ! empty( $um_roles ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, get_option( 'um_roles' ) );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
}
|
||||
|
||||
if ( isset( $args['role'] ) && in_array( $args['role'], $exclude_roles ) ) {
|
||||
unset( $args['role'] );
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
|
||||
if ( in_array( $args['role'], $exclude_roles ) ) {
|
||||
unset( $args['role'] );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_user( $args );
|
||||
|
||||
@@ -314,8 +314,9 @@ function um_submit_form_errors_hook_( $args ) {
|
||||
foreach ( $array['conditions'] as $condition ) {
|
||||
list( $visibility, $parent_key, $op, $parent_value ) = $condition;
|
||||
|
||||
if ( ! isset( $args[ $parent_key ] ) )
|
||||
if ( ! isset( $args[ $parent_key ] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cond_value = ( $fields[ $parent_key ]['type'] == 'radio' ) ? $args[ $parent_key ][0] : $args[ $parent_key ];
|
||||
|
||||
@@ -337,11 +338,11 @@ function um_submit_form_errors_hook_( $args ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'greater than' ) {
|
||||
if ( $cond_value > $op ) {
|
||||
if ( $cond_value > $parent_value ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'less than' ) {
|
||||
if ( $cond_value < $op ) {
|
||||
if ( $cond_value < $parent_value ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'contains' ) {
|
||||
@@ -367,11 +368,11 @@ function um_submit_form_errors_hook_( $args ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'greater than' ) {
|
||||
if ( $cond_value <= $op ) {
|
||||
if ( $cond_value <= $parent_value ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'less than' ) {
|
||||
if ( $cond_value >= $op ) {
|
||||
if ( $cond_value >= $parent_value ) {
|
||||
continue 2;
|
||||
}
|
||||
} elseif ( $op == 'contains' ) {
|
||||
|
||||
@@ -1377,40 +1377,46 @@ function um_profile_menu( $args ) {
|
||||
|
||||
<div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
|
||||
<?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
|
||||
<a href="<?php echo $nav_link; ?>" class="um-tip-n uimob500-show uimob340-show uimob800-show"
|
||||
<a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
|
||||
title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
|
||||
<i class="<?php echo $tab['icon']; ?>"></i>
|
||||
|
||||
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
|
||||
<span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
|
||||
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
<span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
|
||||
|
||||
<span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo $tab['name']; ?></span>
|
||||
</a>
|
||||
<a href="<?php echo $nav_link; ?>" class="uimob500-hide uimob340-hide uimob800-hide"
|
||||
title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
<a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
|
||||
title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
|
||||
<i class="<?php echo $tab['icon']; ?>"></i>
|
||||
|
||||
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
|
||||
<span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
|
||||
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
<span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
|
||||
|
||||
<span class="title"><?php echo $tab['name']; ?></span>
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo $nav_link; ?>" title="<?php echo esc_attr( $tab['name'] ); ?>"
|
||||
original-title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
<a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
|
||||
title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
|
||||
<i class="<?php echo $tab['icon']; ?>"></i>
|
||||
|
||||
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
|
||||
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
|
||||
<?php } ?>
|
||||
</a>
|
||||
<a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
|
||||
title="<?php echo esc_attr( $tab['name'] ); ?>">
|
||||
|
||||
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
|
||||
<span class="um-tab-notifier uimob500-show uimob340-show uimob800-show"><?php echo $tab['notifier']; ?></span>
|
||||
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
<span class="uimob500-hide uimob340-hide uimob800-hide title"><?php echo $tab['name']; ?></span>
|
||||
|
||||
<span class="title"><?php echo $tab['name']; ?></span>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@ function um_after_insert_user( $user_id, $args ) {
|
||||
UM()->user()->remove_cached_queue();
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
UM()->user()->set_status( um_user('status') );
|
||||
UM()->user()->set_status( um_user( 'status' ) );
|
||||
if ( ! empty( $args['submitted'] ) ) {
|
||||
UM()->user()->set_registration_details( $args['submitted'] );
|
||||
}
|
||||
@@ -369,6 +369,30 @@ function um_submit_form_register( $args ) {
|
||||
$args['submitted'] = array_merge( $args['submitted'], $credentials );
|
||||
$args = array_merge( $args, $credentials );
|
||||
|
||||
//get user role from global or form's settings
|
||||
$user_role = UM()->form()->assigned_role( UM()->form()->form_id );
|
||||
|
||||
//get user role from field Role dropdown or radio
|
||||
if ( isset( $args['role'] ) ) {
|
||||
global $wp_roles;
|
||||
$um_roles = get_option( 'um_roles' );
|
||||
|
||||
if ( ! empty( $um_roles ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, get_option( 'um_roles' ) );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
}
|
||||
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
|
||||
//if role is properly set it
|
||||
if ( ! in_array( $args['role'], $exclude_roles ) ) {
|
||||
$user_role = $args['role'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
@@ -391,7 +415,7 @@ function um_submit_form_register( $args ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$user_role = apply_filters( 'um_registration_user_role', UM()->form()->assigned_role( UM()->form()->form_id ), $args );
|
||||
$user_role = apply_filters( 'um_registration_user_role', $user_role, $args );
|
||||
|
||||
$userdata = array(
|
||||
'user_login' => $user_login,
|
||||
@@ -726,4 +750,18 @@ function um_registration_set_profile_full_name( $user_id, $args ) {
|
||||
*/
|
||||
do_action( 'um_update_profile_full_name', $user_id, $args );
|
||||
}
|
||||
add_action( 'um_registration_set_extra_data', 'um_registration_set_profile_full_name', 10, 2 );
|
||||
add_action( 'um_registration_set_extra_data', 'um_registration_set_profile_full_name', 10, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Redirect from default registration to UM registration page
|
||||
*/
|
||||
function um_form_register_redirect() {
|
||||
$page_id = UM()->options()->get( UM()->options()->get_core_page_id( 'register' ) );
|
||||
$register_post = get_post( $page_id );
|
||||
if ( ! empty( $register_post ) ) {
|
||||
wp_safe_redirect( get_permalink( $page_id ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
add_action( 'login_form_register', 'um_form_register_redirect', 10 );
|
||||
@@ -392,11 +392,11 @@ function um_get_custom_field_array( $array, $fields ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'greater than' ) {
|
||||
if ( $cond_value > $op ) {
|
||||
if ( $cond_value > $parent_value ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'less than' ) {
|
||||
if ( $cond_value < $op ) {
|
||||
if ( $cond_value < $parent_value ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'contains' ) {
|
||||
@@ -422,11 +422,11 @@ function um_get_custom_field_array( $array, $fields ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'greater than' ) {
|
||||
if ( $cond_value <= $op ) {
|
||||
if ( $cond_value <= $parent_value ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'less than' ) {
|
||||
if ( $cond_value >= $op ) {
|
||||
if ( $cond_value >= $parent_value ) {
|
||||
$array['required'] = 0;
|
||||
}
|
||||
} elseif ( $op == 'contains' ) {
|
||||
|
||||
@@ -211,7 +211,7 @@ function um_add_search_to_query( $query_args, $args ){
|
||||
*/
|
||||
$query_args = apply_filters( 'um_query_args_filter', $query_args );
|
||||
|
||||
if ( count( $query_args['meta_query'] ) == 1 )
|
||||
if ( isset( $query_args['meta_query'] ) && count( $query_args['meta_query'] ) == 1 )
|
||||
unset( $query_args['meta_query'] );
|
||||
|
||||
return $query_args;
|
||||
|
||||
@@ -47,7 +47,7 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields_Editor' ) ) {
|
||||
if ( empty( $_POST['menu-item-db-id'] ) || ! in_array( $menu_item_db_id, $_POST['menu-item-db-id'] ) ) {
|
||||
return;
|
||||
}
|
||||
//var_dump($_POST['menu-item-um_nav_roles']); exit;
|
||||
|
||||
foreach ( self::$fields as $_key => $label ) {
|
||||
|
||||
$key = sprintf( 'menu-item-%s', $_key );
|
||||
|
||||
+13
-1
@@ -6,7 +6,7 @@ Donate link:
|
||||
Tags: community, member, membership, user-profile, user-registration
|
||||
Requires at least: 4.1
|
||||
Tested up to: 4.9
|
||||
Stable tag: 2.0.15
|
||||
Stable tag: 2.0.17
|
||||
License: GNU Version 2 or Any Later Version
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
@@ -131,6 +131,18 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
|
||||
= Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
|
||||
|
||||
= 2.0.17: May 30, 2018 =
|
||||
|
||||
* Enhancements:
|
||||
- Added UM dashboard widget for getting latest extension's upgrades
|
||||
|
||||
* Bugfixes:
|
||||
- Fixed User Profile restriction when the user isn't logged in
|
||||
- Fixed Profile Tabs displaying on desktop/mobile
|
||||
- Fixed set user status after registration on some installs
|
||||
- Fixed PHP memory limit issue on some installs with small PHP memory limit
|
||||
- Fixed PHP validation on submit UM Forms with conditional fields logic
|
||||
|
||||
= 2.0.16: May 23, 2018 =
|
||||
|
||||
* Bugfixes:
|
||||
|
||||
+1
-1
@@ -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.0.16
|
||||
Version: 2.0.17
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
Text Domain: ultimate-member
|
||||
|
||||
Reference in New Issue
Block a user