Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter activity comment content prior to display?


  • FTLRalph
    Participant

    @ftlralph

    I can’t seem to get to the raw activity comment content prior to html/oembed being applied?

    function modify_comment_content( $activity_content ) { 
    	// at this point, $activity_content is already:
    	// ...
    	// <p>test</p>
    	// <blockquote class="imgur-embed-pub" lang="en" data-id="BY4KOHr"><p><a href="https://imgur.com/BY4KOHr" rel="nofollow">View post on imgur.com</a></p></blockquote>
    	// ...
    	
    	// I'm trying to get the comment content prior to HTML and oembed beint applied?
    	// aka this:
    	// ...
    	// test
    	// http://i.imgur.com/BY4KOHr.png
    	// ...
    }
    add_filter( 'bp_activity_comment_content', 'modify_comment_content', 0, 1 );

    I can’t make the priority any more first than 0, is there another filter I should use instead of bp_activity_comment_content?

Viewing 2 replies - 1 through 2 (of 2 total)

  • FTLRalph
    Participant

    @ftlralph

    Also for what it’s worth, what I’m doing here is catching image links prior to oembed so I can wrap them in <img /> tags (this way it works for all images, not just imgur and a select few)

    Plus oembed is ugly but I like it for Youtube links

    Is there an easier way to do this? Maybe just “don’t use oembed except for Youtube” type of hacking?


    r-a-y
    Keymaster

    @r-a-y

    Maybe just “don’t use oembed except for Youtube” type of hacking?

    BuddyPress just uses whatever oEmbed providers that WordPress uses.

    You can disable oEmbed providers in WordPress with code:
    https://codex.wordpress.org/Function_Reference/wp_oembed_remove_provider

    Hope that helps somewhat. The rest is up to you.

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