Hook to Add New Field Group
-
Hello everyone!
I am developing a BP plugin that needs to create one field group when it gets activates. I can easily do it using $wpdb->insert just like this:function add_profile_group() { global $wpdb; $wpdb->insert( $wpdb->prefix . 'bp_xprofile_groups', array( 'name' => 'Cool Group Name', 'description' => 'blah blah blah ', 'group_order' => 0, 'can_delete' => 0 ) ); } register_activation_hook(__FILE__,'add_profile_group');
and then remove it on deactivation
function remove_profile_group() { global $wpdb; $wpdb->query("DELETE FROM {$wpdb->prefix}bp_xprofile_groups WHERE name = 'Cool Group Name'"); } register_deactivation_hook( __FILE__, 'remove_profile_group' );
So is there any way to do it using BP hooks only?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Hook to Add New Field Group’ is closed to new replies.