Wednesday, January 25, 2023
HomeWordPress Developmentplugins - Take away embed url for inner hyperlinks

plugins – Take away embed url for inner hyperlinks


I’ve a discussion board constructed with bbPress. How can I deactivate embed url for inner hyperlinks? For the remainder of the hyperlinks I wish to be the identical like it’s proper now.
What I attempted is that this however with none outcomes:

add_action('bbp_get_topic_content', 'remove_embed', 1000, 2);
add_action('bbp_get_reply_content', 'remove_embed', 1000, 2);
perform remove_embed($content material, $id){
    international $wp_embed;
    if(!stripos($wp_embed->last_url, 'CUSTOM_WORD') !== false){
        remove_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 );
        remove_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 );
    }
    return $content material;
}

If I put these remove_action exterior of a perform it’s working nice, however applies for each iframe.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments