admin管理员组文章数量:1025478
I use this custom password form in my theme:
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">'.'
<div class="l-password-protect">
<div class="c-password-protect">
<input name="post_password" id="password" class="c-input" type="password" size="20" required placeholder="hasło"/>
<input type="submit" name="Submit" class="c-button" value="' . esc_attr__( 'Submit', 'behold-universal-one' ) . '" />
</div>
</div>
</form>
';
return $o;
}
but when I have more than one post with the same password, after entered it I can unlock those two posts at once. Where's the problem?
EDIT
I modify my code based on this / but problem is still the same.
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form($post = 0) {
$post = get_post( $post );
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
<input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form>
';
return $output;
}
I use this custom password form in my theme:
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">'.'
<div class="l-password-protect">
<div class="c-password-protect">
<input name="post_password" id="password" class="c-input" type="password" size="20" required placeholder="hasło"/>
<input type="submit" name="Submit" class="c-button" value="' . esc_attr__( 'Submit', 'behold-universal-one' ) . '" />
</div>
</div>
</form>
';
return $o;
}
but when I have more than one post with the same password, after entered it I can unlock those two posts at once. Where's the problem?
EDIT
I modify my code based on this / but problem is still the same.
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form($post = 0) {
$post = get_post( $post );
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
<input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form>
';
return $output;
}
本文标签: Custom password form allows unlock two posts with the same password
版权声明:本文标题:Custom password form allows unlock two posts with the same password 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745624633a2159787.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论