conditional activity page for buddypress [closed]

It sounds like you are using a bp_has_members loop on some page. I don’t think you can change a define while in a loop. In that loop, do you have this code? <a href=”https://wordpress.stackexchange.com/questions/226262/<?php bp_member_permalink(); ?>”><?php bp_member_avatar(); ?></a> And / Or: <a href=”https://wordpress.stackexchange.com/questions/226262/<?php bp_member_permalink(); ?>”><?php bp_member_name(); ?></a> Then you could do something like this: <?php … Read more

call custom action after delete account

It depends on what the function myAction() is doing. Your order is this: pluging defines action hook with do_action( ‘bp_members_delete_account_after_submit’ ); You hook a function on that with add_action( ‘bp_members_delete_account_after_submit’, ‘action_bp_members_delete_account_after_submit’ ); the function action_bp_members_delete_account_after_submit() is then adding a hook named ‘myAction’ and passing it two arguments as strings ‘arg1’ and ‘arg2’. But there is … Read more

Hide tab Buddypress profile for visitors, not logged in users

I think the function you are looking for is bp_displayed_user_id(). That will get the ID of the user whose profile is currently being displayed. Then, you can check their role like this: $user = get_userdata( bp_displayed_user_id() ); if ( ! in_array( ‘subscriber’, (array) $user->roles ) ) { return; } You could also use user_can(), but … Read more

After adding my website to a new server, I keep getting a unexpected end of file error, but the file is identitcal to it’s original source

So the issue has already been resolved via the comments and the current state of the question already includes the corrected code. But I thought I should post this answer as a reminder for you, me and everyone reading this. 🙂 So first off, here’s a helpful excerpt from an article on WP Engine: The … Read more

buddypress remove username from autocomplete

Try this but note that it may not send the message: ‘<span id=”%s” href=”#”></span><img src=”%s” style=”width: 15px”> %s %s’ . “\n”, esc_attr( ‘link-‘ . $user->ID ), esc_url( $user->image ), esc_html( $user->name ), ‘ ‘ Or this: ‘<span id=”%s” href=”#”></span><img src=”%s” style=”width: 15px”> %s’ . “\n”, esc_attr( ‘link-‘ . $user->ID ), esc_url( $user->image ), esc_html( $user->name … Read more