Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Action Group Creation


  • robertosalemi
    Participant

    @robertosalemi

    Hello everyone,
    whenever a user creates a group, I would like them to be created pages automatically.

    The code for the realization of the pages I wrote it, but I ask you:
    1) what is the action that tells me that a group has been created?
    2) How do I freeze a name of the current group?
    3) the code is inserted into the functions.php of my theme, right?

    thanks,
    Roberto.

Viewing 4 replies - 1 through 4 (of 4 total)

  • danbp
    Moderator

    @danbp

    As always, Codex is your friend.
    https://codex.buddypress.org/?s=group+api


    robertosalemi
    Participant

    @robertosalemi

    Hi @danbp,
    I resolved with:
    add_action( 'groups_group_create_complete', 'my_function');

    How can I get the informations of current groups?
    For example “name of group” to insert in my page?

    Thanks.


    danbp
    Moderator

    @danbp

    you can try within a custom function:

    if ( class_exists( 'BP_Group_Extension' ) ) : 	
    	$group=groups_get_current_group();

    robertosalemi
    Participant

    @robertosalemi

    I resolved with this code:

    //GET INFORMATION GROUP
    if (!$group = groups_get_group( array( 'group_id' => $group_id ) ) )
    {
    	return false;
    }
    else 
    {
       $group_name = $group->name;
       $group_slug = $group->slug;
    }

    Thanks for all!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Action Group Creation’ is closed to new replies.
Skip to toolbar