E-mail Update – Validation

Well, you comparing the results of the email_exists function with $current_user->ID. If email exists, email_exists() return the ID of the user using that email or false if the email doesn’t exists. Imaging you are checking a email not being using, email_exists() return false and this if will validate: elseif(email_exists(esc_attr( $_POST[’email’] ) ) != $current_user->ID ) … Read more

Remove fields from WordPress profile

These are not default fields added by WordPress. They have to be added via a theme or plugin. You will need go and check where these fields are added. I would speculate that there are some kind of priority set when these fields are registered. You need to add a lower priority (higher number) to … Read more

How do I sort a WP_USER_QUERY by multiple meta fields?

You can do it with ‘orderby’ parameter. Parameter description: Field(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (‘ASC’ or ‘DESC’) as values. Accepted values are ‘ID’, ‘display_name’ (or ‘name’), ‘include’, ‘user_login’ (or ‘login’), ‘login__in’, ‘user_nicename’ (or ‘nicename’), … Read more

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

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