Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Plamen,
    Thank you for the kind words.

    The above code is a sample and you can modify it. For example, I am making a change to allow recording comment from ‘community’ category.

    
    
    function buddydev_disable_activity_blog_comment_recording_conditionally( $enabled, $blog_id, $post_id, $user_id, $comment_id ) {
    
    	// use $post_id to decide.
    	// set $enabled= false; to stop recording comment.
    	if ( ! in_category( 'community', $post_id ) ) {
    		$enabled = false;
    	}
    
    	return $enabled;
    }
    
    add_filter( 'bp_activity_post_pre_comment', 'buddydev_disable_activity_blog_comment_recording_conditionally', 20, 5 );
    
    

    If you can tell me which categories to allow or disallow, I can post the updated code too.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: [Resolved] Slow Queries #22365

    Thank you. Will update here.

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Daniel,
    Thank you for the update. I am glad you were able to get it work.

    Best regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Pamen,
    I am sorry for the delayed reply.

    After reding through the codes, I am assuming our goal here to to stop recording comments in certain cases?
    If that is the case, BuddyPress provides us with another filter

    
    bp_activity_{$post_type}_pre_comment
    

    where for normal posts the $post_type is ‘post’.
    So we can attach to ‘bp_activity_post_pre_comment’.

    Here is an example code

    
    function buddydev_disable_activity_blog_comment_recording_conditionally( $enabled, $blog_id, $post_id, $user_id, $comment_id ) {
    
    	// use $post_id to decide.
    	// set $enabled= false; to stop recording comment.
    
    	return $enabled;
    }
    
    add_filter( 'bp_activity_post_pre_comment', 'buddydev_disable_activity_blog_comment_recording_conditionally', 20, 5 );
    

    You may adapt it from there.

    Hope it helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi,
    The answer to all the questions is “yes”.

    Since you already posted a relevant plugin for login sharing, I will suggest using it and see if that fits you need or not?

    The other way around is using a backup plugin and then keep syncing from 1 to another(db+files both) as you need it both way.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Sam,
    I do agree that there should be a simple way for developres to mark a field as non required(in html attributes).

    It is still doable but too complex at the moment. Please do report it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Please change

    bp_get_signup_page()
    to

    
    wp_login_url()
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485
    Brajesh Singh on in reply to: [Resolved] Slow Queries #22352

    Hi Simon,
    Thank you for sharing. It can certainly be done using transient. Please allow me 2-3 days to audit all our count queries.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25485

    Hi Sam,
    Thank you for sharing.

    The problem is related to Member Types Pro. We have the conditional field option in Member Types pro. It hides a field if it is not needed by a member type.

    Since the field is present on page and BuddyPress adds html “required” attribute to the page, It browsers do not allow submitting.

    You can either disable conditional registration field(as shown below) or mark the fields from the Primary field as non required.
    https://i.imgur.com/bDsr4WR.png

    Any field which might be invisible due to condition should not be marked as required.

    Please see my hilighted note in point 4 here. We were expecting this issue
    https://buddydev.com/docs/buddypress-member-types-pro/conditional-buddypress-registration-fields-based-on-buddypress-member-types/

    Sorry for the inconvenience.
    If you have suggestions on how can we make the docs on this better, Please help me make it better and avoid such issue for others in future.

    Thank you
    Brajesh