Will WordPress username displayed somewhere in the site?

I would definitely not advise you to enforce this policy. For example, I can enumerate through your list of authors by simply entering yoursite.com/?author=1, yoursite.com/?author=2, etc into my browser. This will take me to your author pages. If your users were savvy enough, they might have set their public display name in Users/Your Profile to … Read more

How to hook into user registration process Before user registers

You need to create your own hook for registration_errors filter: add_filter( ‘registration_errors’, ‘wpse8170_registration_errors’, 10, 3 ); function wpse8170_registration_errors( $errors, $sanitized_user_login, $user_email ) { if ( /* something happens */ ) { $errors->add( ‘myexception_code’, ‘This is my message’ ); } return $errors; }

Problem with email_exists in shortcode

This is a basic version of your code above which seperates the registration logic (handled on init) from the form output done by the shortcode. It will basically work, but is missing any validation so just to show the concept. $wpse_email_exists = null; function registration_form_shortcode() { global $wpse_email_exists; $output=”<form name=”registration” action=”” . esc_url($_SERVER[‘REQUEST_URI’]) . ‘” … Read more

Best way to create a user programatically

You should read the codex page re wp_create_user. You don’t describe the context in which your code runs. You shouldn’t need all those require_once calls. Anyhow, in this line wp_new_user_notification ( testuser8,null,’both’ ); what is testuser8 ? It’s not a variable, it’s not a string, it’s just some text that probably throws an error. Try: … Read more

Register theme customizer settings when theme activates [duplicate]

You need only use the default value on the wp_customize and that is all $wp_customize->add_setting(‘mytextoption’, array( ‘default’ => ‘defaultvalue’, ‘capability’ => ‘edit_theme_options’, ‘type’ => ‘option’, replace defaultvalue for the value you want, and when the user activate the theme this line will register the default value on the DB only when not exist on the … Read more