袋熊的正确答案为-3时的mfw
很抱歉没有发表评论,但我这里还没有任何回购协议,我真的只是想知道wordpress上发生了什么。stackexchange。com公司
袋熊到底应该给这增加什么?我们有一个WP安装,其中包含一些来自codex的旧代码(同时codex应该对当前WP版本进行更正)。wordpress。com在我们的主题中functions.php
文件自定义密码表单,例如:
<?php
function my_password_form() {
global $post;
$label = \'pwbox-\'.( empty( $post->ID ) ? rand() : $post->ID );
$o = \'<form action="\' . esc_url( site_url( \'wp-pass.php\', \'login_post\' ) ) . \'" method="post">
\' . __( "To view this protected post, enter the password below:" ) . \'
<label for="\' . $label . \'">\' . __( "Password:" ) . \' </label><input name="post_password" id="\' . $label . \'" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="\' . esc_attr__( "Submit" ) . \'" />
</form>
\';
return $o;
}
add_filter( \'the_password_form\', \'my_password_form\' );
?>
在一些更新中,WP更改了表单,但当我们在
functions.php
我们现在得到OP在所讨论的更新之后描述的错误。现在我们改变了
wp-pass.php
到
/wp-login.php?action=postpass
正如袋熊所说(如当前法典页面所示):
<?php
function my_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\' ) ) . \'" method="post">
\' . __( "To view this protected post, enter the password below:" ) . \'
<label for="\' . $label . \'">\' . __( "Password:" ) . \' </label><input name="post_password" id="\' . $label . \'" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="\' . esc_attr__( "Submit" ) . \'" />
</form>
\';
return $o;
}
add_filter( \'the_password_form\', \'my_password_form\' );
?>
问题已解决。(对于任何已经实现了导致此问题的自定义过滤器的人来说,Wombat提供的信息应该没有问题……那么,你们为什么要降低他的评分呢??)