BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Yuriix,

    Please try the following code:

    
    /**
     * Check if user can post activity
     *
     * @return bool
     */
    function buddydev_user_can_post_activity() {
    
    	if ( bp_is_group_activity() ) {
    		return true;
    	}
    
    	// Replace ids by your allowed user ids.
    	$allowed_user_ids = array( 24, 2 );
    
    	$can = false;
    	if ( is_super_admin() || in_array( get_current_user_id(), $allowed_user_ids ) ) {
    		$can = true;
    	}
    
    	return $can;
    }
    
    add_action( 'bp_before_activity_post_form', function() {
    
    	if ( ! buddydev_user_can_post_activity() ) {
    		ob_start();
    	}
    
    } );
    
    add_action( 'bp_after_activity_post_form', function() {
    
    	if ( ! buddydev_user_can_post_activity() ) {
    		ob_get_clean();
    
    		$css = '#buddypress form#whats-new-form {display: none};';
    
    		wp_add_inline_style( 'bp-legacy-css', $css );
    	}
    } );
    
    add_action( 'bp_enqueue_scripts', function () {
    	if ( ! buddydev_user_can_post_activity() ) {
    		$css = '#buddypress form#whats-new-form {display: none};';
    
    		wp_add_inline_style( 'bp-parent-css', $css );
    	}
    }, 15 );
    
    /**
     * Filter ajax post request
     */
    function buddydev_restrict_post_update() {
    
    	// Always allow site admin.
    	if ( buddydev_user_can_post_activity() || function_exists( 'bp_nouveau' ) ) {
    		return;
    	}
    
    	$object = empty( $_POST['object'] ) ? '' : sanitize_key( $_POST['object'] );
    
    	if ( ! $object || 'user' == $object || bp_is_user_activity() ) {
    		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'You are not allowed to post activity.' ) . '</p></div>' );
    	}
    }
    
    add_action( 'wp_ajax_post_update', 'buddydev_restrict_post_update', 9 );
    
    

    Please replace the old code with this and give it a try.

    Note: It will hide the posting form on the activity directory as well. But users can post group activity within the group.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] GROUP TABS: Sub-Tabs Formatting #44893

    Hello Dianne,

    Thank you for the feedback. Tabs are depended on your Theme style with 2.0 BuddyBoss does offer a grey style tab. You can member’s sub-tabs If they are showing different please let me know.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] GROUP TABS: Sub-Tabs Formatting #44881

    Hello Dianne,

    Please upgrade the plugin and give it a try and let me know if subtabs are highlighted with BuddyBoss 2.0 or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Bakhta,

    Thank you for posting. BuddyPress does support WordPress core fields “Biographical Info” and “First Name, Last Name, Website” under the Text field option. For Social Network fields it seems they are offered by some kind of plugin. If yes, please contact the plugin author to add support for the BuddyPress Profile field.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Fabien,

    Thank you for posting. Please try the following code on gist:

    https://gist.github.com/raviousprime/0247df63d7d9214e7d2470128b06c0cd

    Please let me know if it helps or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddypress conditional registration #44664

    Please note that privacy policy acceptance works with the Nouveau template pack.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddypress conditional registration #44663

    Hello Tosin,

    Thank you for posting. BuddyPress does provide default functionality for privacy acceptance. It only checks a published privacy policy page. You can find Privacy Policy page settings under Settings > Privacy page in the dashboard. Please make sure your privacy page is published.

    Please give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Chris,

    Thank you for your acknowledgement. Please replace ‘ksort’ with ‘asort’ function. It will sort countries by name.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] xprofle on header #44661

    Hello Giuseppe,

    Thank you for cooperating with us.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Dale,

    Use this code either in your active theme ‘functions.php’ file or ‘bp-custom.php’ file.

    For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi