Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,840
- How-to & Troubleshooting
- 129,871
- Creating & Extending
- 25,908
- Requests & Feedback
- 9,550
- Third Party Plugins
- 9,832
- Showcase
- 3,316
- Ideas
- 1,402
- Miscellaneous
- 9,179
-
Try:
function example_insert_category( $group_id ) {
$group = groups_get_group( array( 'group_id' => $group_id ) );
$name = $group->name;
$slug = $group->slug;
wp_insert_term(
$name,
'category',
array(
'description' => 'This is an example category.',
'slug' => $slug
)
);
}
add_action('groups_group_create_complete', 'example_insert_category', 1, 1);