BuddyDev

Search

Replies

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

    Hello Panos,

    I have tested the plugin on my local development server and it is working fine. Please let me know which version of the plugin you are using it was a bug in older version but fixed by the new version.

    Thank You
    Ravi

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

    Hello Tosin,

    Thank you for the acknowledgment. Yes plugin is conflicting with our custom code. Please use the following code and let me know it works or not.

    
    function buddydev_hide_buttons() {
    
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	$restricted_user_ids = array( 5, 26, 10, 4 ); // Replace by yours user ids.
    
    	if ( ! in_array( get_current_user_id(), $restricted_user_ids ) ) {
    		return;
    	}
    
    	if ( function_exists( 'bp_profile_message_ux_init' ) ) {
    		remove_all_filters('bp_get_send_public_message_button');
    		remove_all_filters('bp_get_send_message_button');
    	}
    
    	add_filter( 'bp_get_send_public_message_button', '__return_false' );
    	add_filter( 'bp_get_send_message_button_args', '__return_false' );
    }
    add_action( 'bp_init', 'buddydev_hide_buttons', 11 );
    

    Regards
    Ravi

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

    Hello Tosin,

    Strange, This code is working for me. Can you please post me the code you are using.

    Regards
    Ravi

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

    Hello Tosin,

    For user ids, you can use the following code.

    
    function buddydev_hide_public_button( $r ) {
    
    	if ( ! is_user_logged_in() ) {
    		return $r;
    	}
    
    	$restricted_user_ids = array( 5, 26, 10, 4 ); // Replace by yours user ids.
    
    	if ( in_array( get_current_user_id(), $restricted_user_ids ) ) {
    		return false;
    	}
    
    	return $r;
    }
    add_filter( 'bp_get_send_public_message_button', 'buddydev_hide_public_button' );
    add_filter( 'bp_get_send_message_button_args', 'buddydev_hide_public_button' );
    
    

    Regards
    Ravi

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

    Hello Thorsten,

    Thank you for posting. As per sreenshot there will be no errors and code will work fine. You can use this.

    Thank you for the translations

    Regards
    Ravi

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

    Hello Tosin,

    Please try the following code to hide public and private buttons based on user capability. Please follow the following url for more user capabilities.

    https://codex.wordpress.org/Roles_and_Capabilities

    
    function buddydev_hide_public_button( $r ) {
    
    	if ( ! current_user_can( 'publish_posts' ) ) {
    		return false;
    	}
    
    	return $r;
    }
    add_filter( 'bp_get_send_public_message_button', 'buddydev_hide_public_button' );
    add_filter( 'bp_get_send_message_button_args', 'buddydev_hide_public_button' );
    
    

    Use this code in your “bp-custom.php file”

    Thanks
    Ravi

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

    Hello Kreatsya,

    Sorry, This is beyond the scope of BuddyBlog plugin right now. It won’t be able to support these features and will need a lot of change which we are unable to add currently.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddyblog disable featured image #17644

    Hello Kreatsya,

    Thank you for posting. We have updated BuddyBlog plugin settings. Now it has setting to allow/disallow users to upload featured image to post. Please download the latest version.

    https://buddydev.com/plugins/buddyblog/

    Thanks
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Notifications #17150

    Hello Travis,

    Thank you for posting. Please refer the following gist url:

    https://gist.github.com/raviousprime/d822dab7403858500159d94cc6e01278

    Use the code in your “bp-custom.php” file and Please do let me know.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Buddypress Unread Message Count #17149

    Hello Mwale,

    Thank you for asking. There is a message function with name “messages_get_unread_count( $user_id = 0 )” it returns unread message count for the user id. Please try this.

    Regards
    Ravi