How to Merge Two Authors Into One?

Yes, this is a good question and the answer is basic WordPress 101 (core), contrary to the two comments above. No plugin necessary. You simply go to Users and delete the author (user) that you don’t want to keep. WordPress then asks you if you want to delete their content or attribute it to another … Read more

Confirmation required on email change

Like SickHippie posted this functionality is native to WordPress but only for a multisite setup so here is the two functions you need to get this to work on a single site setup which are mostly code one for one from the core /wp-admin/user-edit.php file function custom_send_confirmation_on_profile_email() { global $errors, $wpdb; $current_user = wp_get_current_user(); if … Read more

get_user_meta() doesn’t include user email?

get_user_meta retrieves a single meta field or all fields of the user_meta data for the given user. This means that all the values that are stored in user_meta table can be got using get_user_meta. Email is not stored as meta data so you cant get email using get_user_meta. Email is stored with username and password … Read more

Showing User’s Post Counts by Custom Post Type in the Admin’s User List?

Here’s an expansion of Mike’s tutorial answer. I added links to the types listed so you can click on one and be taken right to a listing of all the posts in that type for that author, which required an additional variable for $counts and some extra output for $custom_column[] add_action(‘manage_users_columns’,’yoursite_manage_users_columns’); function yoursite_manage_users_columns($column_headers) { unset($column_headers[‘posts’]); … Read more

Get multiple roles with get_users

Fastforward to WordPress 4.4 – it will support the role__in attribute! It looks like WordPress 4.4 is our lucky version number, because it will support both the role__in and role__not_in attributes of the WP_User_Query class. So to include the subscriber, contributor and author roles, we can simply use: $users = get_users( [ ‘role__in’ => [ … Read more

Override WordPress user with Oauth2 account

If you can stick to overriding just functions that are located in wp-includes/pluggable.php then you should be able to avoid any kind of plugin conflicts … unless you are using plugins that are overriding the same pluggable functions. Just make sure that your functions are declared before pluggables is loaded. Plugins are loaded before the … Read more

Setting admin edit panels & metaboxes positions and visibility for ALL users and admins

You can remove the default meta boxes with remove_meta_box and re-add them in a different position with add_meta_box: add_action(‘do_meta_boxes’, ‘wpse33063_move_meta_box’); function wpse33063_move_meta_box(){ remove_meta_box( ‘postimagediv’, ‘post’, ‘side’ ); add_meta_box(‘postimagediv’, __(‘Featured Image’), ‘post_thumbnail_meta_box’, ‘post’, ‘normal’, ‘high’); } The answer above is from the following thread: How to change default position of WP meta boxes? UPDATE If the … Read more

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