Here’s the solution how to use Nouveau theme hooks.
It’s a bit complicated, but I’ve not found a way easier. And no other instructions.
1. Find the hook you need.
2. Search through the buddypress files and find the function with the same name (hook is a function, so find the source).
In my example it’s function bp_nouveau_xprofile_hook($when = ”, $suffix = ”) {} (code reference page)
3. Write down the array with all $hook components.
Here they are bp/after/profile/loop_content
I’d like to say that the pattern is
bp/first-argument-in-hook/hook-name-from-function/second-argument-in-hook
but here I had to change xprofile to profile, so the source code is still essential.
4. Merge the array with _ (bp_after_profile_loop_content)
5. Congratulations! We’ve got a custom action name and can continue with add_action().
Honestly, I don’t understand why it has to be so complicated now, but here we are.
I’ve been attempting to get the below to work, but little trouble with getting it to load the stream itself due to changes that Twitch has done
// Add's Twitch Channel To BuddyPress Profiles
if(!class_exists('BP_Twitch_Tab')):
class BP_Twitch_Tab {
public $tab_name = 'Twitch TV';
public $content_title = 'Twitch TV Channel';
public $url_slug = 'twitchtv';
public $subnav_slug = 'twtchtv';
public $tab_position = 40;
public $show_chat = true;
// channel name will be grabbed from buddypress field $field_name
public $channelName = null;
public $field_name = 'Twitch Channel';
public function __construct () {
add_action('bp_setup_nav', array($this, 'profile_tab'));
}
// add profile tab
public function profile_tab() {
global $bp;
// get channel name
$this->channelName = bp_get_profile_field_data('field=' . $this->field_name . '&user_id=' . bp_loggedin_user_id());
if($this->channelName) {
bp_core_new_nav_item( array(
'parent_url' => bp_loggedin_user_domain() . '/' . $this->url_slug . '/',
'slug' => $this->url_slug,
'default_subnav_slug' => $this->subnav_slug,
'parent_slug' => $bp->profile->slug,
'name' => $this->tab_name,
'position' => $this->tab_position,
'screen_function' => array($this, 'screen_function')
) );
}
}
// call actions on profile screen
public function screen_function() {
add_action( 'bp_template_title', array($this, 'template_title') );
add_action( 'bp_template_content', array($this, 'template_content') );
bp_core_load_template( 'buddypress/members/single/plugins' );
}
// add content title
public function template_title() {
echo $this->content_title;
}
// show iframe
public function template_content() {
?> <iframe src="//www.twitch.tv/<?php echo $this->channelName; ?>/embed" frameborder="0" scrolling="no" height="500" width="100%"></iframe> <?php
// show chat
if ($this->show_chat) {
?> <iframe frameborder="0" scrolling="no" class="chat_embed" src="//twitch.tv/chat/embed?channel=<?php echo $this->channelName; ?>&popout_chat=true" height="400" width="100%"></iframe> <?php
}
}
}
endif;
new BP_Twitch_Tab;
Buddypress 6.1.0 and “BuddyPress Nouveau” template.
Theme suffusion child.
JS error on page: /members/me/messages/
Uncaught SyntaxError: Unexpected token ‘;’
at new Function (<anonymous>)
at Function.v.template (underscore.min.js?ver=1.8.3:formatted:954)
at i.template (wp-util.min.js?ver=5.4.2:2)
at i.render (wp-backbone.min.js?ver=5.4.2:2)
at i.render (buddypress-messages.min.js?ver=6.1.0:formatted:576)
at i.setPreview (buddypress-messages.min.js?ver=6.1.0:formatted:584)
at p (backbone.min.js?ver=1.4.0:2)
at f (backbone.min.js?ver=1.4.0:2)
at l (backbone.min.js?ver=1.4.0:2)
at i.n.trigger (backbone.min.js?ver=1.4.0:2)
and no massages displayed.
Help, please.
When a post is added under “Activity” tab, it would be very helpful to send an auto email notification to pre-selected members.
How to send an auto email notification to pre-selected group members when a post is added under “Activity” tab?
Below is the required info/link
WordPress version version 5.4.2
BuddyPress version Version 6.1.0
Link to my site esCanada.org
The previous buddypress theme used actions, for example do_action( ‘bp_after_profile_content’ ).
Now there’re hooks instead, for example bp_nouveau_xprofile_hook( ‘after’, ‘loop_content’ );
And I cannot find any information how these hooks can be used.
What function do I have to use instead of add_action now?
I installed BuddyPress today and registered a new account.
When I tried to log in I get two errors in red boxes:
ERROR: Authentication failed.
ERROR: You have entered an incorrect reCAPTCHA value.
I have tried resetting the password and it still didn’t work.
On the reCAPTCHA, it’s the math version and I know the answers have been correct.
Link: https://ohiovarsity.com/register/
Thank you @vapvarun
I will contact them asap
But I guess “settings” are adjusting in BuddyPress; then how can I change that permalinks?
and also when I change the permalinks which I mentioned in post in ChildTheme it works, but in normal theme it seems no effect. Why?
Best regards,
How do I add bbpress information to BuddyPress profile
Hello i have this odd issue with buddypress. When i setup my site on my home server i was able to change my avatar and my cover image.
After i move my site using duplicator plugin into my web server images can be uploaded you can see them but as soon as you refresh or go to a diferent page the avatar/cover image is back to the default one.
I’m running nginx web server and i’m also using cloudflare.
Any ideas?
there is a buddydev plugin BuddyPress Clear Notifications, you can use it
Hi,
I’m using BuddyPress – I have found a plugin that will delete posts before ‘x’ date. Although cant find a way of bulk deleting the media that was associated with that post.
Is there any way of deleting images from the media library that are not attached to posts?
Thanks
@jadedartist check with Youzer support, media is not part of BuddyPress.
@tarryntyler try to toggle ( enable/disable )group component if it’s still not working disable other plugins except BuddyPress to isolate possible plugin conflict.
I just installed the child theme customizer for karuna the second time, and changed the colors only. this time when installing, the buddypress groups stopped working and giving error 404. I deactivated and reactivated both bb press and buddypress plugins, removed and added back group feature, but still cannot add or use them them even from within the admin session. using up to date buddypress noveau and plugins, and never had issues with groups before. website is dailyyogi.world
Hi, thanks for replying. I’m not as interested as having content or a private community. I am interested in not indexing all links generated by buddypress, such as mypage / members / juan
I consider that these links do not generate any value for my site.
With that code can I achieve this?
@danielafer use private community plugin or BP lock , it will help to keep your community private for logged in users.
If you do not want the private community approaches you can also use no-index.
function no_index_for_buddypress() {
if ( is_buddyPress() ) {
echo '<meta name="robots" content="noindex, nofollow">';
} else {
}
}
add_action( 'wp_head', 'no_index_for_buddypress' );
It is the third time that I ask and I don’t get any answer to my question:
How can I avoid indexing the links generated by the plugin, for example profiles, activities, groups, etc.
@pedroverdi
Hi
I try to get Divi working with BuddyPress, but I cannot get access to BuddyPress short codes…
Can you help?
Gérard
I’ve got Woocommerce, Shop Isle Theme and a vew assorted plugins including bbpress and buddypress.
Everything works great until I try to install ANY plugin involving newsletter features. Then I get an error that’s ONLY in the WP Admin area, usually involving running out of memory (even though my limits are nearly maxxed out).
So installing the following ALL break just the backend:
Mailpoet
Newsletter
Icegram
MailChimp
These things were all playing together nicely until the most recent update to Buddypress, now all of it breaks every time I’ve got the following switched on:
Woocommerce
ANY of the Newsletters above
bbpress
Buddypress
Can anyone advise on what I can do? Or is there a way to roll back to the previous version before everything started breaking?
Cheers.
How to disable buddypress e-mail activation for users – only admins can approve accounts ?
i disabled the user mail using this link : https://gist.github.com/KaineLabs/c0dfe6d07c64c1ab0d34046e7853251a
but the admin not receive any mail regarding new user signup
@shanebp is it possible to make all buddypress activities into posts?
– i already have a plugin that makes posts into nice grid templates ..and i could insert on a page with a shortcode
– would it then be possible to make all buddypress activities into posts .. So i can put this shortcode on my homepage, and so everytime a user makes at activity, it becomes a post and appears on that post grid on the home page
Is this possible.. With a plugin?
You need to create a custom template for activity and adjust the layout to your liking.
Info re how to overload a template.
@flpagan Can you clarify whether you’re referring to the theme’s header or a default group’s or member’s profile header/ cover image?
If you’re referring to the theme’s header, please contact theme author.
If you’re referring to the cover images for groups or members, try this https://wordpress.org/plugins/buddypress-cover-photo/ – haven’t used it myself. Good luck.
I see many people seem to have this problem and the site I am writing for a client certainly does – when a user loads a new Avatar picture, the result is a tiny dot and it is impossible to crop.
This is a deal-breaker for using BuddyPress – does anyone have a work around?
I am using Avada theme but have tested it with 2020 and still no luck.