Create a category with the userlogin or username at registration
-
Hello, the project I’m doing must be able to create a category with the userlogin or username at registration. The code below works, but only for one category. Can I change it to have what I need; (username = user_categories) ?
// Autogenerate category—
function example_insert_category() {
wp_insert_term(
‘Example Category’,
‘category’,
array(
‘description’ => ‘This is category created with wp_insert_term.’,
‘slug’ => ‘example-category’
)
);
}
add_action( ‘after_setup_theme’, ‘example_insert_category’ );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Create a category with the userlogin or username at registration’ is closed to new replies.