Skip to:
Content
Pages
Categories
Search
Top
Bottom

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()

    change

    $newoptions['text'] = strip_tags( stripslashes( $_POST['bp-widget-welcome-text'] ), '<img>' );

    to

    $newoptions['text'] = stripslashes(wp_filter_post_kses( $_POST['bp-widget-welcome-text'] ));

Viewing 19 replies - 1 through 19 (of 19 total)
  • Nice.

    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.

    done, added as ticket #272


    David Bisset
    Participant

    @dimensionmedia

    ok stupid question – where do you setup the welcome message? :)


    Burt Adsit
    Participant

    @burtadsit

    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.


    David Bisset
    Participant

    @dimensionmedia

    Smacking forehand. Thanks burt.


    christianbryant
    Member

    @christianbryant

    @PerS Great tip. Thanks. Used it right away as I tested my first foray into BuddyPress.


    Adam W. Warner
    Participant

    @awarner20

    Ahhhh…sigh of relief. Thanks for the quick and easy fix!


    Andy Peatling
    Keymaster

    @apeatling

    This change is now in the trunk.


    Seobrien
    Participant

    @seobrien

    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


    Lance Willett
    Participant

    @lancewillett

    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.

    See a sample screenshot.

    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”.


    Seobrien
    Participant

    @seobrien

    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”


    Lance Willett
    Participant

    @lancewillett

    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.


    Aron Jay
    Participant

    @aronjay

    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..


    aran
    Participant

    @aran

    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?!…:-)


    Kunal17
    Participant

    @kunal17

    Aran, I think that is on purpose for security purposes.

    Aron, which is the plugin that modifies the welcome widget for logged in users?


    aran
    Participant

    @aran

    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…:-)


    3180856
    Inactive

    I am using Buddypress 1.0.1 and added code:

    <img src=”http://www.smallinternetbusiness.com/wp-content/images/search_engine_optimization_consultant.jpg”/&gt;

    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


    alunsina
    Participant

    @alunsina

    if you followedthe instructions avove and not able to make it work you might also need to add this at line 42, same file:

    <?php if ( $options['text'] ) : ?><p><?php echo $options['text'] ?></p><?php endif; ?>

Viewing 19 replies - 1 through 19 (of 19 total)
  • The topic ‘suggested change in welcome widget’ is closed to new replies.
Skip to toolbar