id == 'profile' ) ? $user_ID : $_REQUEST['user_id']; ?>
$field ) {
if ( ! $field['native']
&& $field['type'] != 'password'
&& $field['type'] != 'checkbox'
&& $field['type'] != 'multiselect'
&& $field['type'] != 'multicheckbox'
&& $field['type'] != 'file'
&& $field['type'] != 'image' ) {
( isset( $_POST[ $meta ] ) ) ? $fields[ $meta ] = $_POST[ $meta ] : false;
} elseif ( $meta == 'password' && $field['register'] ) {
$chk_pass = true;
} elseif ( $field['type'] == 'checkbox' ) {
$fields[ $meta ] = ( isset( $_POST[ $meta ] ) ) ? $_POST[ $meta ] : '';
} elseif ( $field['type'] == 'multiselect' || $field['type'] == 'multicheckbox' ) {
$fields[ $meta ] = ( isset( $_POST[ $meta ] ) ) ? implode( $field['delimiter'], $_POST[ $meta ] ) : '';
}
}
/**
* Filter the submitted field values for backend profile update.
*
* @since 2.8.2
*
* @param array $fields An array of the posted form values.
* @param int $user_id The ID of the user being updated.
*/
$fields = apply_filters( 'wpmem_admin_profile_update', $fields, $user_id );
// Get any excluded meta fields.
$exclude = wpmem_get_excluded_meta( 'admin-profile' );
foreach ( $fields as $key => $val ) {
if ( ! in_array( $key, $exclude ) ) {
update_user_meta( $user_id, $key, $val );
}
}
if ( $wpmem->mod_reg == 1 ) {
$wpmem_activate_user = ( isset( $_POST['activate_user'] ) == '' ) ? -1 : $_POST['activate_user'];
if ( $wpmem_activate_user == 1 ) {
wpmem_a_activate_user( $user_id, $chk_pass );
} elseif ( $wpmem_activate_user == 0 ) {
wpmem_a_deactivate_user( $user_id );
}
}
if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) {
if ( function_exists( 'wpmem_a_extenduser' ) ) {
wpmem_a_extend_user( $user_id );
}
}
/**
* Fires after the user profile is updated.
*
* @since 2.9.2
*
* @param int $user_id The user ID.
*/
do_action( 'wpmem_admin_after_user_update', $user_id );
return;
}
/**
* Adds user activation to the user profile.
*
* @since 3.1.1
*
* @global object $wpmem
* @param int $user_id
*/
function wpmem_profile_show_activate( $user_id ) {
global $wpmem;
// See if reg is moderated, and if the user has been activated.
if ( $wpmem->mod_reg == 1 ) {
$user_active_flag = get_user_meta( $user_id, 'active', true );
switch( $user_active_flag ) {
case '':
$label = __( 'Activate this user?', 'wp-members' );
$action = 1;
break;
case 0:
$label = __( 'Reactivate this user?', 'wp-members' );
$action = 1;
break;
case 1:
$label = __( 'Deactivate this user?', 'wp-members' );
$action = 0;
break;
} ?>
|
|
use_exp == 1 ) {
if ( ( $wpmem->mod_reg == 1 && get_user_meta( $user_id, 'active', true ) == 1 ) || ( $wpmem->mod_reg != 1 ) ) {
if ( function_exists( 'wpmem_a_extenduser' ) ) {
wpmem_a_extenduser( $user_id );
}
}
}
}
/**
* Adds user registration IP to the user profile.
*
* @since 3.1.1
*
* @param int $user_id
*/
function wpmem_profile_show_ip( $user_id ) { ?>
|
|