Last active
October 17, 2019 10:35
-
-
Save hostz-frank/3559c4afd152f6a9b52ef24c4c79bf8d to your computer and use it in GitHub Desktop.
DSGVO-Hinweis bei passwortgeschütztem Inhalt in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Die folgenden Zeilen in die functions.php des aktiven Child-Themes kopieren. | |
add_filter( 'the_password_form', 'custom_password_form' ); | |
function custom_password_form() { | |
global $post; | |
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); | |
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> | |
<p class="pw-notice">Bitte beachten Sie, dass das Absenden eines Passworts ein <b>Cookie</b> in ihrem Browser setzt, das sich 10 Tage lang Ihren Zugang "merkt".<br></p> | |
<label class="pass-label" for="' . $label . '">Passwort: </label> <input name="post_password" id="' . $label . '" type="password" style="background: #ffffff; border:1px solid #999; color:#333333; pad$ | |
</form><p style="font-size:14px;margin:0px;"> </p> | |
'; | |
return $o; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ergebnis (natürlich ab dem Bereich unter dem lilafarbigen Header):