我正在修改我的wp登录。php,但从函数内部。php(为了不破坏核心)。
我需要禁用一个WP\\u错误,代码为:authentication\\u failed。
如果我破解核心并修改wp登录。php代码:
foreach ( $wp_error->get_error_codes() as $code ) {
$severity = $wp_error->get_error_data( $code );
foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
if ( \'message\' == $severity )
$messages .= \' \' . $error_message . "<br />\\n";
else
$errors .= \' \' . $error_message . "<br />\\n";
}
}
收件人:
foreach ( $wp_error->get_error_codes() as $code ) {
$severity = $wp_error->get_error_data( $code );
if($code !==\'authentication_failed\'){ <======= ADDED
foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
if ( \'message\' == $severity )
$messages .= \' \' . $error_message . "<br />\\n";
else
$errors .= \' \' . $error_message . "<br />\\n";
}
}
}
它起作用了。但我不想破解核心,有没有办法从功能上禁用它。php?