How to add an error or notification to an activity?

With enough digging I figured it out. First off you must save your error message to as activity meta data like so: public function send_team_notification($activity) { $message = $this->send_custom_notification($activity->content); if(is_wp_error($message)){ bp_activity_update_meta( $activity->id, ‘custom_error’, $message ); } } This will appear in the database under the wp_bp_activity_meta table like so: From there you can either manually … Read more

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

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