Adding another field to user table

It’s easy. Just add function with your options to show_user_profile and edit_user_profile hooks, and save them on personal_options_update and edit_user_profile_update. Like this for instance (you can add your own fields (text, number etc.)) /********* Additional User Content ***********/ add_action( ‘show_user_profile’, ‘mytheme_extra_profile_fields’ ); add_action( ‘edit_user_profile’, ‘mytheme_extra_profile_fields’ ); function mytheme_extra_profile_fields( $user ) { ?> <?php $customData = … Read more

Redirect admin 403 “Cheatin uh?” admin pages

Sounds like this is what you’re running into. admin_page_access_denied may be the hook you want to use for this. try function dont_show_cheatin_page() { if ( current_user_can( ‘do_not_allow’ ) ) { wp_safe_redirect( admin_url()); // custom redirect instead of Cheatin 403 page exit; } } add_action(‘admin_page_access_denied’, ‘dont_show_cheatin_page’);

Creating a user from a different website

No, you cannot create a user on another install – you need access to the main site (either via WordPress admin or the database). The “Website” field on the “Add New User” form is nothing more than a profile field for storing information about the user (in this case, a URL).

‘pre_user_query’ interfering with user export

‘users’ != $current_screen->id in your file $current_screen is not set therefore, you are getting warning. You can pass custom var in your user query and check before running your code. $blogusers = get_users( ‘orderby=nicename&order=ASC&my_filter=1’ ); Here we are passing my_filter=1 then later we can check in pre_user_query global $wpdb, $current_screen; $vars = $user_search->query_vars; if (isset($current_screen->id) … Read more

Suggest Users basing on User taxonomy

You cannot query users by taxonomy. You will need to rethink your system. What would I do? Keep the taxonomies but use these only to output choosable values – wp_dropdown_categories() Save the selected value AS user meta, NOT AS taxonomies – update_user_meta() Now you can query users by that value – WP_User_Query() Example: This code … Read more

Regenerate user_nicename column

The obvious method would be to write a custom WP-CLI script to run through the table, extract the first and last names, use sanitize_title to create a new nicename and update the record. You’d also need to copy the first and last names in wp_usermeta as you mention, at the same time. I’m not sure … Read more