mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
@@ -114,7 +114,9 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
$arr_options['status'] = 'success';
|
||||
$arr_options['post'] = $_POST;
|
||||
|
||||
UM()->fields()->set_id = absint( $_POST['form_id'] );
|
||||
if ( isset( $_POST['form_id'] ) ) {
|
||||
UM()->fields()->set_id = absint( $_POST['form_id'] );
|
||||
}
|
||||
UM()->fields()->set_mode = 'profile';
|
||||
$form_fields = UM()->fields()->get_fields();
|
||||
$arr_options['fields'] = $form_fields;
|
||||
@@ -135,7 +137,8 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
);
|
||||
|
||||
if ( ! empty( $values_array ) ) {
|
||||
$arr_options['items'] = call_user_func( $ajax_source_func, $arr_options['field']['parent_dropdown_relationship'] );
|
||||
$parent_dropdown = isset( $arr_options['field']['parent_dropdown_relationship'] ) ? $arr_options['field']['parent_dropdown_relationship'] : '';
|
||||
$arr_options['items'] = call_user_func( $ajax_source_func, $parent_dropdown );
|
||||
|
||||
if ( array_keys( $arr_options['items'] ) !== range( 0, count( $arr_options['items'] ) - 1 ) ) {
|
||||
// array with dropdown items is associative
|
||||
|
||||
@@ -504,9 +504,10 @@ if ( ! class_exists( 'um\core\Password' ) ) {
|
||||
$data = get_user_by( 'email', $user );
|
||||
}
|
||||
|
||||
um_fetch_user( $data->ID );
|
||||
|
||||
UM()->user()->password_reset();
|
||||
if ( isset( $data ) && is_a( $data, '\WP_User' ) ) {
|
||||
um_fetch_user( $data->ID );
|
||||
UM()->user()->password_reset();
|
||||
}
|
||||
|
||||
exit( wp_redirect( um_get_core_page('password-reset', 'checkemail' ) ) );
|
||||
}
|
||||
|
||||
@@ -21,6 +21,23 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) {
|
||||
function __construct() {
|
||||
add_action( 'wp_roles_init', array( &$this, 'um_roles_init' ), 99999 );
|
||||
add_action( 'update_option', array( &$this, 'um_on_roles_update' ), 10, 3 );
|
||||
add_action( 'set_user_role', array( &$this, 'remove_user_cache' ), 10, 1 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flush the Cache User Profile on set new user role(s)
|
||||
*
|
||||
* @param int $user_id
|
||||
*/
|
||||
function remove_user_cache( $user_id ) {
|
||||
$user = get_userdata( $user_id );
|
||||
|
||||
if ( ! is_a( $user, '\WP_User' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
UM()->user()->remove_cache( $user_id );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user