admin管理员组文章数量:1426226
I wanted to validate security questions which show's on wp-login page validation is if answers are blank user cant login and if user register with 2 questions and admin change no. question show on login page then validation is if user given all 2 answer which he registered then he login that time not check 3rd question becoz he not registered 3 ques.so, how to add security questions on wp-registration page and after that validate that question on wp-login page
if ( is_array( wp_unslash( $_POST['seq_ques'] ) ) ) {
foreach ( $_POST['seq_ques'] as $key_ques => $quest )
{
for($i=1; $i <= count($all_userans); $i++)
{
if ( wp_unslash( $_POST['seq_ans'] ) ) :
foreach ( wp_unslash( $_POST['seq_ans'] ) as $question => $answer ) :
for($i=1; $i <= count($all_userans); $i++)
{
if ( empty( $answer ) ) {
unset($_POST['seq_ans'] [$question]);
$empty_answer = true;echo 'empty';// exit();
}
}
endforeach;
endif;
if ( ! array_key_exists( $quest,$all_userans ) ) {
//$is_error_question = true;
$is_error_answer = true; $incorrect_answer = true;
echo "array_key_exists";// break;
} else
{
$user_ques[ $question ] = $question ;
}
}
}
}
本文标签: plugin developmenthow to add security questions on wpregistration page and validate it
版权声明:本文标题:plugin development - how to add security questions on wp-registration page and validate it 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745366105a2655521.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论