Skip to:
Content
Pages
Categories
Search
Top
Bottom

prevent URLs in bbpress posts

  • @sowmya002gmailcom

    Participant

    Hi,

    Is there any way to automatically prevent subscribers posting URLs/links in the bbpress forums

    Thanks!
    Sowmya

Viewing 9 replies - 1 through 9 (of 9 total)
  • @robkk

    Moderator

    add this to your child themes functions.php file or insert this snippet into a functionality plugin and all links posted to your forum would just return plain text.

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4    );	
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4    );

    @sowmya002gmailcom

    Participant

    Hi Rob,

    Thanks for your reply!

    Evenif with the above method, the links become not clickable the URL will still be present in the post right? Is there a way to completely remove it off or automatically shorten it so that even google bots won’t see the URLs in the post?

    Thanks!
    Sowmya

    @sowmya002gmailcom

    Participant

    Hi,

    I have one more doubt. Even if we use

    remove_filter( ‘bbp_get_reply_content’, ‘bbp_make_clickable’, 4 );
    remove_filter( ‘bbp_get_topic_content’, ‘bbp_make_clickable’, 4 );

    the activity stream will come up with a clickable link! How can we have the link in the activity stream also non clickable? Is there a way to do it? Please help me.

    Thanks!
    Sowmya

    @robkk

    Moderator

    activity stream sounds like BuddyPress , I am sure there is something similar for that area though.

    @sowmya002gmailcom

    Participant

    Hi Rob,

    Regarding the bbpress part, I could see that the filter used bbp_get_topic_content in fact helps to modify the reply before displaying it. In fact I need to save the edited reply in the database. This is required because the making the URL no clickable is needed only for specific user roles.

    So can you please let me know if we have any action or filter which acts on the reply before it gets saved to the DB and thus save the modified one in DB!

    Thanks!
    Sowmya

    @robkk

    Moderator

    I am not sure,

    you might need some custom development for only making it work on certain user roles and to have the functionality that you want.

    @sowmya002gmailcom

    Participant

    Thanks Rob.

    Hi all,

    Any idea about a bbpress hook that allows to modify the topic or reply before it gets saved to database?

    Thanks!
    Sowmya

    @robkk

    Moderator

    Im not sure maybe bbp_new_reply_pre_insert ?? All the hooks are listed here though.

    http://hookr.io/plugins/bbpress/2.5/hooks/

    @sowmya002gmailcom

    Participant

    Hi Rob,

    Thanks a lot! This is exactly what I was looking for!!!

    Thanks again!
    Sowmya

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar