• Resolved schulle

    (@schulle)


    Hi team!

    I love your plugin and I’ve been using it for years! I am implementing a consent management platform these days and ran into a problem on how to add the data-block-on-consent attribute to different embedds like instagram and youtube.

    My idea was to implement it in two different ways of which none of them work:

    1. functions.php

    add_filter( 'the_content', function( $content ) {
        if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
            $content = str_replace("<amp-instagram", "<amp-instagram data-block-on-consent", $content);
        }
        return $content;
    }, 1 );

    1. custom template single.php

    $content = $this->get( 'post_amp_content' );
     $content = str_replace("<amp-instagram", "<amp-instagram data-block-on-consent", $content);

    Is there any other way how to add that attribute to the AMP components?

    Any help is much appreciated!

    Best,

    Jonas

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding blocking behavior not working’ is closed to new replies.