suggested change in welcome widget
I suggest that the welcome widget is changed so we can use html in it.
To do this, in bp-core-widgets.php, bp_core_widget_welcome_control()
$newoptions['text'] = strip_tags( stripslashes( $_POST['bp-widget-welcome-text'] ), '<img>' );
$newoptions['text'] = stripslashes(wp_filter_post_kses( $_POST['bp-widget-welcome-text'] ));
Also – you can post enhancement tickets in trac like this. There is more chance that it will get noticed and changed if it’s in there.
ok stupid question – where do you setup the welcome message?
The ‘welcome message’ they are talking about is a widget that you can place anywhere in your theme that is widget enabled. Sidebars. You can find it under ‘Widgets’ in the backend. Open it up and you can put whatever text you want in there.
@pers Great tip. Thanks. Used it right away as I tested my first foray into BuddyPress.
Ahhhh…sigh of relief. Thanks for the quick and easy fix!
Where do I find the heading in the code base? I’d like to change it from saying “Welcome” and that isn’t an option in the widget
Where do I find the heading in the code base?
Seobrien, the widget content is stored in the database, not in any of the plugin or theme files.
Log in to your admin site, click Appearance -> Widgets, and look for a Welcome widget there.
Once you enable the widget, click “Edit” next to the Welcome title. That should open up the widget for editing, and you can enter any title and text you wish.
If for some reason you can’t edit the widget as normal, you can also access the content of the Welcome widget directly in the database, by looking in the “wp_1_options” table for an field with an “option_name” of “bp_core_widget_welcome”.
I’m referring to the “Welcome” that still appears after you set it up in the widget. The title shows up as a header beneath the “Welcome” on the blog. I want to change the “Welcome”
A ha! Gotcha…. That is more complicated.
You can change the label by hacking a core file (not recommended). Do this by editing the following lines in “bp-core/bp-core-widgets.php”:
/* Site welcome widget */
wp_register_sidebar_widget( 'buddypress-welcome', __( 'Welcome', 'buddypress' ), 'bp_core_widget_welcome' );
wp_register_widget_control( 'buddypress-welcome', __( 'Welcome', 'buddypress' ), 'bp_core_widget_welcome_control' );
The more elegant and sustainable approach is to use a language file to modify the text. This would be a better approach overall since you can then change any label in one place (the language file) and not have to worry about an update to BuddyPress core files down the road.
For an example of how to use a language file to edit labels and messages, see my comments and suggestions in this thread.
Also is there a possibility to add a logic to the welcome widget like…
If someone visits the site he/she should see the default welcome message then after loggin in the welcome message should change too..
i know that there’s a plugin for this but i think its much better if its included out of the box..
just my 2c’s..
The latest release has got PerS’s fix included in bp-core-widgets – but the ‘Welcome’ section seems to be stripping all html regardless.
Any ideas what might be causing this?!…
Aran, I think that is on purpose for security purposes.
Aron, which is the plugin that modifies the welcome widget for logged in users?
Thanks, Kunal – I’m sure you’re right about that. But Andy included the work around in the trunk, and now (as far as I can see, anyway!) it’s not working any more. I’d love some paragraphs in my Welcome section…
And yes, Aron, a link to that plugin would be great…
I am using Buddypress 1.0.1 and added code:
It only displayed the tag “<img>” instead of the image on the homepage.
I noticed the above code is added to Buddypress 1.0.1. Any ideas on if I am doing anything wrong or is there a code widget problem
- The topic ‘suggested change in welcome widget’ is closed to new replies.