Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How do I allow html in Buddypress Sitewide Notifications? WordPress



I use Buddypress to run a site. I want to be able to use there awesome [[LINK href=""]]Sitewide Notifications[[/LINK]] to take a poll. However, whenever I try to use html (or a shortcode) it strips it out and just displays the plain text.

How can I get it to allow me to send it out as html?

I would like it if I could do anything in a sitwide notification that you can do in the 'Text' widget.

I think may be something to do with the bp-messages-filters.php in buddypress/bp-messages

Thanks in advance.

Answers (2)


Balanean Corneliu answers:

Try this

rokesmith comments:

Interesting idea but it doesn't work. If you send out the shortcode [embedit snippet="test"] then the notice reads [embedit snippet="test"] not the html.

So, for very good reason Buddypress strips out the html or other rendering abilities as the message is sent. My question is how do I stop it doing that?

If I could stop it doing this then perhaps the shortcode would work. However, I wouldn't need it to as I could just send the html.

Balanean Corneliu comments:

BuddyPress provides code filters (apply_filters) to override various things you can try to find the filter for html.

rokesmith comments:

Thank you for the reply.

You are probably right but I don't know which one to apply or where to apply it.

Balanean Corneliu comments:

Check on /bp-core/bp-core-classes.php


Arnav Joy answers:

are you sending private messages ?

rokesmith comments:

Kind of, but not really.

Buddypress allows site admins to use the message-sending capability to send a sitewide notification. It is sent from the same screen as a private message but there is a little box you can tick which makes it a sitewide message.

This message does not appear in users in messages but is rather displayed at the top of each page, or, from 1.9 onwards you can use a widget