wp_user_role of Admin changed to 0
Hi! I had a very strange problem.
Today, I was creating a test user from a mobile phone. Everything went fine, but in the WP dashboard I could no longer see the anything admin related.
I went to the database to realize that my main admin user had changed its wp_user_role from 10 to 0. Changed back to 10 and everything was working fine again.
A couple of things to note.
1) My site has hundreds of users, and every day about 3 new accounts are created, never had a problem.
2) I did not make any update of plugins or anything prior to this event.
3) I’m using a snippet (since about 3 months, nothing new) to avoid admin login in frontend.
add_action( 'um_submit_form_errors_hook_login', 'custom_submit_form_errors_hook_login', 10, 1 );
function custom_submit_form_errors_hook_login( $args ) {
if ( UM()->user()->get_role() == 'administrator' ) {
UM()->form()->add_error( 'user_email', __( 'Restricted area ?', 'ultimate-member' ) );
}
}
To be honest I can not tell 100% sure if this was a UM problem, but since the problem happened in the exact same time when I was creating a user I need to start from here.
Wp version 6.3.1
UM version 2.6.10
Thanks!
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس