Exclude specific user_id from args in get_comments

Looks like I had to figure this one out myself. replace $comment_meta_args and $replies with global $wpdb; $comment_meta_args=”SELECT * FROM `$wpdb->comments` WHERE `comment_approved` = 1 AND `comment_parent` = (“. intval($parent_comment_id) .”) AND `user_id` != 1 ORDER BY comment_date ASC LIMIT 3″; $replies=$wpdb->get_results($comment_meta_args);

How To Display Author Photo In WordPress without any plugin?

Well if you want to do this yourself first you’ll have to make sure that the form supports enctype: /** Add Encryption Type to User Forms to allow Uploads **/ function profile_form_edit( ) { echo ‘ enctype=”multipart/form-data”‘; } add_action( ‘user_edit_form_tag’ , ‘profile_form_edit’ ); Then you’re going to have to add a new field that allows … Read more

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.