From ca945d2d8031841d2952523770393798ee55982a Mon Sep 17 00:00:00 2001 From: s4luorth Date: Mon, 8 Jun 2026 08:24:33 +0200 Subject: [PATCH] feat: third-party-scripts blockieren (server + client-guard) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Loest die YouTube/Vimeo-API-Luecke: viele dienste laden ueber \n"; } public static function enqueue_assets(): void { @@ -147,6 +205,31 @@ class CB_Renderer { return $out; } + /** + * Shortcode: [content_blocker_consent id="youtube" text="…" style="button|link"] + * A consent control for services that only block scripts (no visible embed + * to click). Grants consent for the given service id and reloads so the + * blocked scripts/embeds load. + */ + public static function consent_shortcode( array|string $atts = [] ): string { + $atts = shortcode_atts( [ + 'id' => '', + 'text' => __( 'Externe Inhalte aktivieren', 'gdpr-content-blocker' ), + 'style' => 'button', + ], $atts, 'content_blocker_consent' ); + + $id = sanitize_key( $atts['id'] ); + if ( $id === '' ) { + return ''; + } + $class = $atts['style'] === 'link' ? 'cb-revoke-link' : 'cb-revoke-btn'; + + return '' + . esc_html( $atts['text'] ) + . ''; + } + /** * Shortcode: [content_blocker_services] * Lists every configured third-party service with the Art. 13 details diff --git a/gdpr-content-blocker/includes/class-settings.php b/gdpr-content-blocker/includes/class-settings.php index e478ef4..adeca90 100644 --- a/gdpr-content-blocker/includes/class-settings.php +++ b/gdpr-content-blocker/includes/class-settings.php @@ -616,10 +616,10 @@ class CB_Settings { value="1" > -