Tag Info

New answers tagged


Just wanted to let you know you have get_user_meta and get_userdata. The email address can be found using the get_userdata function. For the current user this code can apply: <?php $user_id = get_current_user_id(); $user_info = get_userdata($user_id); $mailadresje = $user_info->user_email; echo $mailadresje; ?> Please note this is ...


Please edit your function and add code used below for adding user role in functions.php This is basic idea how roles can be added and removed and how you can check your filed values. Please use according to your requirements. add_action( 'profile_update', 'my_profile_update', 10, 2 ); function my_profile_update( $user_id, $old_user_data ) { // here you ...


You're close - just need to tweak your arguments: <?php echo get_user_meta( $customer_id, 'billing_phone', true ) ?> Just make sure $customer_id is the ID of the user - you probably want get_current_user_id() instead.


update_user_meta will store the value permanently, as you are expecting. How ever in your case, there are multiple scenerio where you can loose those data. Thats the reason you are seeing empty result. First check when are you running the update_user_meta. Is it on every page request. If so then $_POST['the new value'] shouldn't be empty. If it is empty ...


Try this: Inside WP Loop: <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a> If used within The Loop, the user ID need not be specified, it defaults to current post author. A user ID must be specified if used outside The Loop.


The rich_editing user option stores this check box value: wether or not do enable the visual editor for that particular user. If it's disabled then the content editor will look like this:


Here a code example with explanation in the comments: // First a check whether the use is logged in or not: if ( is_user_logged_in() ) { // The user is logged, retrieve the user id $user_ID = get_current_user_id(); // Now we have got the user's id, we can pass it to the function 'count_user_posts': echo 'Number of posts published by user: ' . ...

Top 50 recent answers are included