Skip to:
Content
Pages
Categories
Search
Top
Bottom

remove paragraph markup from around status updates in the activity stream


  • Roger Coathup
    Participant

    @rogercoathup

    I’m trying to remove the paragraph ([p] [/p]) markup that gets inserted around status updates when they are displayed in the activity stream.

    I’ve tried adding the following to my bp-custom.php:

    remove_filter( ‘bp_get_activity_content_body’, ‘wpautop’ );
    remove_filter( ‘bp_get_activity_content’, ‘wpautop’ );

    But, it has no effect.

    Anyone have a fix?

Viewing 3 replies - 1 through 3 (of 3 total)
  • works in the theme’s function.php file (also make sure you don’t have curly quotes – at least copying the above code resulted in)


    Brajesh Singh
    Participant

    @sbrajesh

    or you can keep in bp-custom.php, if you hook it to init action.

    add_action("init","remove_autop_filters_from_activity");
    function remove_autop_filters_from_activity(){
    remove_filter( 'bp_get_activity_content_body', 'wpautop' );
    remove_filter( 'bp_get_activity_content', 'wpautop' );
    }

    Actually, the remove filter should be called after the filter is actually added.


    Roger Coathup
    Participant

    @rogercoathup

    Thanks guys (both solutions work) –

    I’m always forgetting to hook calls to the init action in bp-custom.php. I won’t again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘remove paragraph markup from around status updates in the activity stream’ is closed to new replies.
Skip to toolbar