Create category on user sign up
-
Hi
I need to create a category when a new user signs up. The category name should have the username when registering.
I tried editing wp-login.php and wp-signup.php with different codes. My last attempt was with:
require_once(ABSPATH . "wp-admin/includes/taxonomy.php"); //Define the category $category_fields = array('cat_name' => $user_name, 'category_description' => '', 'category_nicename' => $user_name, 'category_parent' => ''); // Create the category $category_fields_id = wp_insert_category($category_fields);at the end of wp-signup.php but still can’t create a new category. What am I doing wrong?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Create category on user sign up’ is closed to new replies.