How to add an attribute to a user?

The easiest trick is to use the user_contactmethods – the fields don’t actually have to be contacts, but WordPress will do all the leg work for you (displaying the fields & saving the data): function wpse_183763_user_contactmethods( $methods, $user ) { $methods[‘my_field_1’] = ‘My Label For Field 1’; $methods[‘my_field_2’] = ‘My Label For Field 2’; return … Read more

Create new user from phpMyAdmin

Edit the user in phpmyadmin, enter the password as text in the user_pass field and there is a “Function” column with drop down boxes. On this field just select MD5 in the function column. When you save it phpMyAdmin will automatically md5 hash it for you.

How to get its meta_value of a specific meta_key within wp_usermeta

@Cristián Lávaque Thank you for the hints 😉 Actually I managed to resolve the issue blocking this function (show the hidden comment above). In case this would help anyone here is the final working code: function check_post_limit() { if ( current_user_can( ‘edit_posts’ ) ) { global $userdata; global $wpdb; $s2member_last_payment_time = get_user_meta( get_current_user_id(), ‘wp_s2member_last_payment_time’, true … Read more

WordPress /users/me endpoint request forbidden

The subset of data you are seeing is the publicly available author data. ie. if a user has published content on the site, their name, gravatar and description is deemed public data and available to un-authenticated requests. If you’re seeing this user data you can assume the access_token is invalid.

wp_usermeta – Read from database, but save function broken

You have not provided the whole code so don’t understand where you are wrong, this script is working fine for me. add_action( ‘personal_options_update’, ‘save_extra_profile_fields’ ); add_action( ‘edit_user_profile_update’, ‘save_extra_profile_fields’ ); function save_extra_profile_fields( $user_id ) { if ( current_user_can(‘edit_user’,$user_id) ) update_user_meta($user_id, ‘uidnumber’, sanitize_text_field($_POST[‘uidnumber’])); } add_action(‘show_user_profile’, ‘show_extra_profile_fields’); add_action(‘edit_user_profile’, ‘show_extra_profile_fields’); function show_extra_profile_fields( $user ) { ?> <p class=”form-row form-row-wide”> … Read more

Buddypress avatar image in database [closed]

BuddyPress does not store the avatar path in the database. It loads avatars using the directory path – usually …/wp-content/uploads/avatars/. For example, the full sized avatar for a member might be …/wp-content/uploads/avatars/1/ef1e70a512662ea4fdca5b2efb6f76ab-bpfull.jpg where 1 is the user_id. Check your BP installation to find the exact path to the avatars.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)