my custom css file downloads then it STOPS!
It looks like all you need is to add a trailing slash so the directory is correct. Solution: change ‘style.css’ to ‘/style.css’ in your second wp_register_style() call on line 7.
It looks like all you need is to add a trailing slash so the directory is correct. Solution: change ‘style.css’ to ‘/style.css’ in your second wp_register_style() call on line 7.
the function wp_new_user_notification is one of the Pluggable Functions. In the documention you can read: Pluggable functions were introduced in WordPress 1.5.1 These functions let you override certain core functions via plugins. The most up-to-date list of core functions that WordPress allows plugins to override is available at wp-includes/pluggable.php. WordPress loads the built-in functions only … Read more
What about using WordPress Options API to store a flag whether it is the first switch or not: https://codex.wordpress.org/Options_API <?php add_action(‘after_switch_theme’, ‘setup_theme_options’); function setup_theme_options () { if(get_option(‘first_theme_activation’) === false){ // Set a flag if the theme activation happened add_option(‘first_theme_activation’, true, ”, false); // stuff here only runs once, when the theme is activated for the … Read more
There are a few things to note: there is no error checking on wp_insert_user, so there’s no way to know if it failed and why wp_insert_user can be used to set the role etc, the follow up calls aren’t needed, if you read the official docs, there are parameters for those fields Never modify the … Read more
The WordPress wp_users table uses an ID that is an auto-increment integer for unique user ID. There is no way to change that without making significant changes to the way WordPress works, and even if you do that, you will break most plugins that depend on the integer value for user ID. I don’t see … Read more
Yes, WordPress checks for duplicate emails internally, but not duplicate usernames To test this I ran this several times via wp shell: wp_create_user( ‘test’, ‘password’, ‘[email protected]’ ); The result on the second attempt was: => class WP_Error#1962 (2) { public $errors => array(1) { ‘existing_user_email’ => array(1) { [0] => string(42) “Sorry, that email address … Read more
You need to use strlen() to determine the length of a variable, so your second if condition is invalid. As it is, this question is not really related to WordPress, so likely off-topic.
user_register action hook is performed without any output, therefore you can’t echo anything from it. If you’re looking to debug the output from this function, dump it to the error log. function send_coupon_to_freshly_registered_user($user_id) { $user = get_user_by(‘id’,$user_id); //new line $user_email = stripslashes($user->user_email); //changed line error_log( print_r( $user_email, true ) ); // print_r the variable to … Read more
It’s possible if you have access to WP CLI: wp user import-csv https://developer.wordpress.org/cli/commands/user/import-csv/
how can i display custom coded php form in only one page in front end? The best way to go would be to create a custom page template then create a page inside WordPress admin and select your newly created template for that page. how can i make that page ristricted for registered user only? … Read more