Remove admin menu links for multiple users by email
Correct usage: $arr = array(‘[email protected]’,’[email protected]’); in_array($user->user_email, $arr)
Correct usage: $arr = array(‘[email protected]’,’[email protected]’); in_array($user->user_email, $arr)
You can hook into the user_register action hook and lower case the strings manually, by using the wp_update_user function. Here’s a quick example: add_action( ‘user_register’, ‘callback_function’, 10, 1 ); function callback_function( $user_id ) { // Get the user by their ID $user = get_user_by( ‘id’, $user_id ); // Update their user_login wp_update_user( array( ‘ID’ => … Read more
That action doesn’t pass that data: function return_user_data_on_logout( $user ) { Here, $user will alway be undefined. Additionally, you need to tell add_action how many parameters the function takes. But.. do_action( ‘clear_auth_cookie’ ); No information is passed to begin with, that’s not how this particular event/action works. So how do we get the current user … Read more
You’ve got almost everything you need already (assuming the above plugins that you listed work). You just need to link them: Activate pippins change password plugin & create a page with the shortcode for that in it. Test that that page allows a logged in user to change their password. Note the URL of the … Read more
I have no knowledge or experience with Firebase specifically, so I will answer generally as it could be applicable to any external App / User Database synchronization. The password is the tricky part, as WordPress hashes the password before putting it in the database, and so does not by default store the plain text password … Read more
It does not. It simply imports them as if they’ve always been a user.
You could set up a child theme, and in the single-listing.php template, add conditions around the current code. <?php // If the user is not logged in, redirect if ( false == is_user_logged_in() ) { wp_redirect( wp_login_url() ); exit; } // Else the user is logged in; show the listing else { // Paste the … Read more
One user account per person would definitely be easier, but I think you could kind of get this done by playing with the user sessions, which are stored as user_meta with the session_tokens key. Something along these lines maybe. add_action(‘template_redirect’, ‘check_max_num_sessions’); function check_max_num_sessions() { // Only check for logged in users if ( is_user_logged_in() ) … Read more
In this code: if ($gender == ‘his_Male’) { $wpgender=”Male”; } elseif ($gender=”her_Female”) { $wpgender=”Female”; } else { $wpgender=”Other”; } You’re not comparing $gender to ‘her_Female’, you’re setting it to ‘her_Female’: } elseif ($gender=”her_Female”) { You should be using == or === (preferably ===, the difference is documented here). Your second question is really a chrome-php … Read more
This solution is purely cosmetic, in that it simply hides via jQuery the fields on the user profile page, but that effectively removes the ability for the user to change the password (admin will still see the fields, and can change any time). Add this to your theme’s functions.php file, and you’re done. add_action( ‘edit_user_profile’, … Read more