Skip to:
Content
Pages
Categories
Search
Top
Bottom

update group activities just for admins


  • meisinotti
    Participant

    @meisinotti

    Hi!

    I want my members to become BuddyPress group members. That’s no problem so far.
    But I do not want them to update activities (send group posts). This should only be allowed for admins.

    How can I realize this?

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

  • Nahum
    Participant

    @nahummadrid

    @meisinotti you can restrict the post form to admins depending on what template pack you use… you could set something like,

    with nouveau, /buddypress/activity/post.form.php, overload it child theme

    /*
     * Template tag to prepare the activity post form checks capability and enqueue needed scripts.
     */
    
    if(bp_is_group_activity() && current_user_can('administrator')) {
    
    bp_nouveau_before_activity_post_form();
    ?>
    
    <h2 class="bp-screen-reader-text"><?php echo esc_html_x( 'Post Update', 'heading', 'buddypress' ); ?></h2>
    
    <div id="bp-nouveau-activity-form" class="activity-update-form"></div>
    
    <?php
    /*
     * Template tag to load the Javascript templates of the Post form UI.
     */
    bp_nouveau_after_activity_post_form();
    }
    

    assuming you don’t allow users to create their own groups, if you want to allow them to post updates on their own created groups then you’d need to check for that.


    Nahum
    Participant

    @nahummadrid

    Edit timed out on me up there and didn’t get to revise my reply in time!

    /buddypress/activity/post.form.php, overload it child theme

    /*
     * Template tag to prepare the activity post form checks capability and enqueue needed scripts.
     */
    
    if( bp_is_group() && !current_user_can('administrator') ) {
    
    } else {
    
    bp_nouveau_before_activity_post_form();
    ?>
    
    <h2 class="bp-screen-reader-text"><?php echo esc_html_x( 'Post Update', 'heading', 'buddypress' ); ?></h2>
    
    <div id="bp-nouveau-activity-form" class="activity-update-form"></div>
    
    <?php
    /*
     * Template tag to load the Javascript templates of the Post form UI.
     */
    bp_nouveau_after_activity_post_form();
    
    }
    
    

    meisinotti
    Participant

    @meisinotti

    Thank you! I will give it a try.


    meisinotti
    Participant

    @meisinotti

    Thank you, it works great. But it turns out that I’d need an exception for a single group. Only in this one all members be allowed to post updates. Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar