Josh Harrison
Forum Replies Created
-
Forum: Plugins
In reply to: [New User Approve] Add a different admin email addressI have an addon available for purchase that gives you more control over who gets the admin emails (https://newuserapprove.com).
That plugin is just using filters so it can be done without the addon.
This code would need to be added to a separate plugin or to your theme:
function email_admin( $to ) { // add more email addresses $to[] = '[email protected]'; return $to; } add_filter( 'new_user_approve_email_admins', 'email_admins' );
Forum: Plugins
In reply to: [New User Approve] Disable Randomly Generated PasswordsYes. It is best to use a child theme if it is possible. You have the right idea though. In any case, it is a good way to see if it works as you would like.
Forum: Plugins
In reply to: [New User Approve] Stops admin accessThat’s not good. Does this same behavior happen when it is the only plugin that is active?
Forum: Plugins
In reply to: [New User Approve] Custom Email notificationSorry about that. Here is a code sample to do what you wanted.
/** * Modify the contents of the message sent to the admin when a user signs up. * * @param $message The default message. * @return string the updated message. */ function my_custom_message( $message ) { $new_message = 'USERNAME (USEREMAIL) has requested a username at SITENAME' . "\n\n"; $new_message .= "SITEURL\n\n"; $new_message .= 'To approve or deny this user access to SITENAME go to' . "\n\n"; $new_message .= "ADMINURL\n\n"; return new_message; } // modify the message sent to the admin add_filter( 'new_user_approve_request_approval_message_default', 'my_custom_message' );
Forum: Plugins
In reply to: [New User Approve] New User Confirmation EmailsThat’s good to hear. Thanks for letting us know.
Forum: Plugins
In reply to: [New User Approve] Custom Email notificationHere is what you’d want to do:
/** * Modify the message sent to a user after being approved. * * @param $message The default message. * @param $user The user who will receive the message. * @return string the updated message. */ function my_custom_message( $message, $user ) { $message = 'Custom message here'; return $message; } // add a new custom approval message add_filter( 'new_user_approve_approve_user_message', 'my_custom_message', 10, 2 ); // add a new custom denial message // use this for a denied user //add_filter( 'new_user_approve_deny_user_message', 'my_custom_message', 10, 2 );
You don’t have to hack core to do this. You can add a filter to your functions.php file or a separate plugin.
This code will turn it off for you:
/* * Don't reset password. This filter is useful if your site allows new * users to set their own password. */ add_filter( 'new_user_approve_do_password_reset', '__return_false' );
Forum: Plugins
In reply to: [New User Approve] Suggestion: add a register linkNot a bad idea. I’ll consider it for an upcoming release.
Forum: Plugins
In reply to: [New User Approve] Unapproved User not showing up in "Pending" sectionIt’s acting like the cache isn’t being updated. Did this just happen for you once or does it happen consistently? Do you have a lot of users on your site? Are you using a caching plugin?
Forum: Plugins
In reply to: [New User Approve] sends username and password before approval.That plugin does not make it possible to disable the email sent with the login info.
Forum: Plugins
In reply to: [New User Approve] Does this work with BuddyPressBuddyPress is not yet supported.
Forum: Plugins
In reply to: [New User Approve] Disable Randomly Generated PasswordsYou can add it to your functions.php file in your current theme. That is the easiest way to do it. I would not recommend modifying the plugin code as that will update and your changes will get lost.
Forum: Plugins
In reply to: [New User Approve] sends username and password before approval.What plugin are you using for the registration form?
Forum: Plugins
In reply to: [New User Approve] Users metaIf a user does not have a status, it is probably because that user registered when the NUA plugin was not activated. They are approved if no status is in the meta table.
Here is a code snippet from the plugin that you might find helpful:
if ( $status != 'approved' ) { // Query the users table $query = array( 'meta_key' => 'pw_user_status', 'meta_value' => $status, ); $wp_user_search = new WP_User_Query( $query ); } else { // get all approved users and any user without a status $query = array( 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'pw_user_status', 'value' => 'approved', 'compare' => '=' ), array( 'key' => 'pw_user_status', 'value' => '', 'compare' => 'NOT EXISTS' ), ), ); $wp_user_search = new WP_User_Query( $query ); }
Forum: Plugins
In reply to: [New User Approve] sends username and password before approval.Do you mind sharing the site with me where the problem is occurring?