Add user data to table when user is created?

Looks to me you should be seeking a woocommerce purchase completion hook. This would be when you could add that a donation has been made and at what amount, then you could grab any user information, amounted donated and other info you need and save it to your donor table. use this: add_action(‘woocommerce_order_status_completed’, ‘save_to_donors’,10,1); instead … Read more

Order users by last word of last name

This should do it: usort($users, ‘wpse_235438_sort_users’ ); function wpse_235438_sort_users( $a, $b ) { $a_last_name = array_pop( explode( ‘ ‘, $a->last_name ) ); $b_last_name = array_pop( explode( ‘ ‘, $b->last_name ) ); return strnatcasecmp( $a_last_name, $b_last_name ); } explode() will convert your names into arrays; array_pop() will give you the last item in those arrays, which … Read more

How do I customize the dashboard?

Subscribers will see the WP Events and News widget, but they shouldn’t be seeing the other stuff. Somewhere the theme and/or plugins are adding widgets in a way that’s allowing all user levels to see them. You can either hit up the support teams for the themes and plugins that are adding them, or you … Read more

How to set show admin bar front to true for all users?

You can use update_user_option() function (see codex) Your loop looks fine to me, so probably this would work: // Create the WP_User_Query object $wp_user_query = new WP_User_Query(array(‘role’ => ‘Subscriber’)); // Get the results $users = $wp_user_query->get_results(); // Check for results if (!empty($users)) { // loop trough each author foreach ($users as $user) { // update … Read more