Get tags for current user

The currently logged in user The \WP_User object/instance can be retrieved via: $user = get_current_user(); There’s a shortcut API wrapper to fetch the ID: $user_id = get_current_user_id(); $wpdb and the WP “DBAL” WP basically uses $wpdb as DBAL/Database Abstraction Layer. It got plenty of public methods and some higher level wrappers for convenient access. One … Read more

New users not showing up in Post -> Edit

s_ha_dum’s answer prompted me to look into this a little further. I checked the users in the database. It turns out that the dropdown list in Posts -> Edit is using the Display Name, not the User Login, as I had expected. So, the problem was not that WordPress was functioning incorrectly, but that my … Read more

Exclude admin from user list

You could use user_can( $user_id, ‘manage_options’ ) to gauge the ids in the users array and unset($users->[$x]) the appropriate row. I would personally use $users = array(); foreach ($results as $user) if (!user_can( $user->ID, ‘manage_options’ )) $users[] = $user; But that’s just me.

Remove user profile field [duplicate]

Part 1 Create wpse_admin_user.css file and put it in your current theme, where style.css is: tr.user-admin-color-wrap, tr.user-admin-bar-front-wrap { display: none; } Add this code to your theme’s functions.php: function wpse_user_admin_script() { wp_register_style( ‘wpse_admin_user_css’, get_stylesheet_directory_uri() . ‘/wpse_admin_user.css’ ); wp_enqueue_style( ‘wpse_admin_user_css’ ); } add_action( ‘admin_enqueue_scripts’, ‘wpse_user_admin_script’ ); Part 2 Install and activate Custom User Profile Photo plugin. … Read more