Replies
Hi Brajesh,
Thank you I hope you and family are well.
I have the following code in my child theme and I’m trying to eliminate php notices (Trying to get property of non-object) by reference to the logs.
/** * Sync Buddypress Name to Username */ function my_member_username() { global $members_template; return $members_template->member->user_login; } add_filter( 'bp_member_name' , 'my_member_username' ); function my_bp_displayed_user_fullname() { global $bp; return $bp->displayed_user->userdata->user_login; } add_filter( 'bp_displayed_user_fullname' , 'my_bp_displayed_user_fullname' );
The line at issue is (line 54):
return $bp->displayed_user->userdata->user_login;
Here are the pointers:
wp-content/themes/Avada-child/functions.php:54 my_bp_displayed_user_fullname() wp-includes/class-wp-hook.php:288 apply_filters('bp_displayed_user_fullname') wp-content/plugins/buddypress/bp-members/bp-members-template.php:1885 bp_get_displayed_user_fullname() wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-component.php:434 BP_Activity_Component->setup_title() wp-includes/class-wp-hook.php:288 do_action('bp_setup_title') wp-content/plugins/buddypress/bp-core/bp-core-dependency.php:174 bp_setup_title() wp-includes/class-wp-hook.php:288 do_action('bp_init') wp-content/plugins/buddypress/bp-core/bp-core-dependency.php:252 bp_init() wp-includes/class-wp-hook.php:288 do_action('init') wp-settings.php:523
Without going to much trouble, do you have any ideas that might help?
Many thanks,
MikePHP errors (notification) for core avatars is fixed here:
https://buddypress.trac.wordpress.org/attachment/ticket/8177/bp-core-avatars.patch
This will help prevent your log from filling with a huge number of entries each day.
PPS I just want to be sure, for example, if I make the Member Types in the sub-site, should I make the same Member Type in the main site? Or does the Member Type only apply to each sub-site?
Because it is my first live sub-site I’ve become a bit confused. I noticed that Members from the main site can log in to the sub-site as I expected. However, they get the Participant Role and they don’t get the Subscriber Role. This means I can’t give them a network-wide badge (because we can’t give Participants a badge). I expected they would get the subscriber Role, that is one reason why I got confused about it.
To clarify, as a minimum I wanted every Member on every site to have the Member Type of “Community Member”.
Thanks
- This reply was modified 5 years ago by Mike (DesignServe).
Also, if I set up member Types and Badges separately in the sub-site, is it ok to have the same names for the Member Types as in the main site? Currently, I Synchronise the users from sub-sites to main site with a User Sync plugin.
- This reply was modified 5 years ago by Mike (DesignServe).
members/ means that exact slug is not cached.
members/* means that members/ and all slugs below it are not cached. So for example, profile editing wouldn’t be cached or anything else that includes that slug
Sorry got to be brief 🙂
Thank you Brajesh I’ll be able to test in the next few days. Let me know if I owe you a payment.