Forum Replies Created
-
In reply to: Huge Performance improvement suggestion
Ah, what’s more or even worse: This incredibly inperformant function
xprofile_filter_kses()
is ran several times during the same pageload on the same data:Once for this hook:
add_filter( 'xprofile_get_field_data', 'xprofile_filter_kses', 1 );And yet another time in this call-chain for displaying:
add_filter( 'bp_get_the_profile_field_value', 'xprofile_sanitize_data_value_before_display', 1, 3 );Please have a look!
Profiles are a huge bottleneck due to this design flaw! Thanks!In reply to: Mass-PM usersWhy the heck is messages_new_message() so damn slow?
I can merely send ONE PM per second… even though I already disabled the mail notification.There must be an incredible overhead in messages_new_message …. What do you think?
In reply to: Mass-PM usersI think I found it:
Remocving this hook before calling “messages_new_message”:remove_action( 'messages_message_sent', 'messages_notification_new_message', 10 );In reply to: Orphaned Avatars and Cover PhotosIt works. Thanks and bye
In reply to: Orphaned Avatars and Cover PhotosSOMEONE GUYS?
In reply to: Friend Requests Shortcode?!Just programm it using custom functions. Aint that hard.
Just temporarly overwriting by using the has_capabilities hook 🙂In reply to: BUG in bp_remove_member_typeThank you Mathieu Viet!
I think it would be even more “reliable” to fix it directly within bp_get_member_type to return an empty array instead of false, so that not every function using bp_get_member_type must add the check “is_array” – what do you think?In reply to: Filter User posts within specific GroupGot it, looks good…
This codes applies to group 5, i.e. within group 5, a user can only see his own posts AND the posts of admins:add_filter('bp_before_activity_get_parse_args', function($r) { if(current_user_can('administrator')) return $r; if(@$r['filter']['object'] == 'groups' && @@$r['filter']['primary_id'] == 5) { $r['filter']['user_id'] = array_merge(get_users(array('role' => 'administrator', 'fields' => 'ID')), array(bp_loggedin_user_id())); } return $r; }, 1, 1);Basically to fix this issue if the JS does not work properly, do a check in the Ajax call itself:
Modify the friend add AJAX call, and add the condition:
$res = BP_Friends_Friendship::check_is_friend(bp_loggedin_user_id(), $_POST['item_id']); if(!in_array($res, array(false, 'not_friends'))) { wp_send_json_error($response); }Funny, just as I posted, I saw this on github:
https://github.com/buddyboss/buddyboss-platform/issues/1199But this was created only concerning the REST API.
This happens also directly in the frontend… We have this situation every week once or so … 🙁In reply to: Friend Requests Shortcode?!add_shortcode('friendship_requests', function() { global $bp; add_filter('bp_displayed_user_id', function($id) { return bp_loggedin_user_id(); }); $bp->current_action = 'requests'; ob_start(); bp_get_template_part('members/single/friends'); return ob_get_clean(); });This is a shortcode [friendship_requests] which kind of works.
But not completely.
For example the buttons to approve the connection request etc are missing.
Also I have a plugin with extended friendship request message which can be added to a friendship request – it’s also NOT shown / hooked.E.g. in the official Loop / URL:

With my Shortcode it looks like:

Okay, but how to use a variable outside a function and pass it to the callback function?
I think version 1 is cleaner – BUT: unfortunately to use $members_args, unfortunately I have to change members loop – which I’d like to keep to the original one if possible.
In reply to: Group Type DirectoryUnfortunately it doesn’t work either 🙁
In reply to: Force strong password in RegistrationI meant this link here: https://wordpress.org/support/topic/buddypress-profile-change-password-skipped/
Here someone is complaining about it as well.
So right now, no solution on the internet 🙁In reply to: Force strong password in RegistrationSee, the plugin doesnt work on “password change” for existing users:
https://wordpress.org/support/plugin/force-strong-passwords/🙁
In reply to: Force strong password in RegistrationThanks, but it seems, that the BP form to change your profile is somehow altered and not the “original” WP form to change user settings, hence theres no check right now 🙁 Also “Force Strong Passwords” doesnt do anything, I can simply submit a weak password…
In reply to: Creating custom profile fields with predefined TagsAny ideas to add tags? 🙂 Please!!! Any plugin?