Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I include only one group to have a snippets ?

  • Avatar of 4ella
    4ella
    Participant

    @4ella

    Hi , I would like to use Snippets only in one group (Group dedicated only to Snippets) and I don’t want to have a snippets included in other group creations – delete that step. Does anybody knows how can I achieve that ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of imath
    imath
    Moderator

    @imath

    hi, you can try to do the following :

    replace line 218 to 220 so this code :
    `if(get_option( ‘cs-enable’ )){
    bp_register_group_extension( ‘Bp_Code_Snippets’ );
    }`

    by this code :
    `if(get_option( ‘cs-enable’ )){
    global $bp;
    if($bp->groups->current_group->id==[your_group_id]){
    bp_register_group_extension( ‘Bp_Code_Snippets’ );
    }
    }`

    and of course replace [your_group_id] by the ID of your group.

    Avatar of 4ella
    4ella
    Participant

    @4ella

    @imath – thank you very much !! will do that tonight , will let you know , if everything is ok .

    Avatar of 4ella
    4ella
    Participant

    @4ella

    I am trying to find group ID , how can I find it ? I was trying to search for that here but there’s any info about that .

    Avatar of 4ella
    4ella
    Participant

    @4ella

    I have found that groups ID : after I have installed groups management , then this showed this error below , so I have deleted : ” [ ] ” and it worked perfectly now
    Parse error: syntax error, unexpected ‘[‘ in /home2/……./public_html/……/wp-content/plugins/bp-code-snippets/bp-code-snippets.php on line 220

    so correct code is here and thank you really very much : perfect work @imath

    `if(get_option( ‘cs-enable’ )){
    global $bp;
    if($bp->groups->current_group->id==your_group_id){
    bp_register_group_extension( ‘Bp_Code_Snippets’ );
    }
    }`

    Avatar of imath
    imath
    Moderator

    @imath

    You’re welcome.

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

You must be logged in to reply to this topic.