Difference between Option_Group and Option_Name in Register_Settings

The codex defines the function as: register_setting( $option_group, $option_name, $option_validate_function ); $option_group is settings group name. Use when displaying on a settings page for example $option_name is the database entry name $option_validate_function is the callback for this database entry/this option. Most codex tutorials use an array of data in one $option_name but that’s not required … Read more

Filter username field on registration for profanity and unwanted words

There are two very different hooks you can use, depending on the installation: wpmu_validate_user_signup for multi-site and registration_errors for single-site. The following untested code shows how to use them. You can tweak the array in user_name_is_forbidden() to your needs. Use regular expressions for the matches. // multi-site add_filter( ‘wpmu_validate_user_signup’, function( $result ) { // there … Read more

How do I create a password reset link?

After much research, I finally turned to examining the WordPress core file wp_login.php hoping that WP would show how they do it in a non-obtuse manner. From the information around line 331 (WP 4.6.1), I put together the following code. <?php global $gw_activate_template; extract( $gw_activate_template->result ); $url = is_multisite() ? get_blogaddress_by_id( (int) $blog_id ) : … Read more

User Without Email?

It’s possible, just no so easily via the Users page without some hackery. The WordPress API will let you insert users without email addresses, so a little custom plugin to accept a login name and password, and a call to wp_insert_user or wp_update_user should work for you. Unfortunately I don’t have time to code it … Read more

Google Apps login in wordpress

Use the plugin WordPress Social Login: http://wordpress.org/extend/plugins/wordpress-social-login/ Does exactly what you want except the user doesn’t actually have to type in their username and password if they are already logged in to Google Apps – they just click the Google icon and it will log them in to WordPress using Google Apps. And yes, you … Read more

What’s the difference between wp_insert_user() and wp_create_user()

None. The whole source of wp_create_user() is: function wp_create_user($username, $password, $email=””) { $user_login = esc_sql( $username ); $user_email = esc_sql( $email ); $user_pass = $password; $userdata = compact(‘user_login’, ‘user_email’, ‘user_pass’); return wp_insert_user($userdata); } It just calls insert version almost immediately, basically a shorthand wrapper. As for why it exists – core works in mysterious ways … Read more

How do I customise the new user welcome email

SB Welcome Email Editor works by replacing wp_new_user_notification() with an own version. The original version can be found in wp-includes/pluggable.php, the plugin uses an elaborate replacement with all kinds of options. You can do this to: create a new plugin (just a PHP file in wp-content/plugins/), and define wp_new_user_notification($user_id, $plaintext_pass=””) there. This will then be … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedueduedueduedusedueduseduedu