登录时使用wp-admin会返回白色空白页,但是如果刷新,它将变为正常

问题描述

我正在WordPress网站上工作,在某种情况下我很少陷入困境,我在功能文件添加了一些钩子,例如(登录重定向)。到现在为止一切正常,我只遇到一个错误,即 当我使用wp-admin url登录时,它将重定向或返回给我插入管理仪表板页面的空白页面,但是如果我刷新该页面,它将恢复正常。我在wp-config文件中将WP_DEBUG设置为true,并显示以下错误:-

Notice: Undefined index: redirect_tojk in /home/bloctnpt/public_html/jobifyinc.com/newsite/wp- 
content/themes/workscout/functions.PHP on line 739

Notice: Undefined index: redirect_to_resume_section in 
/home/bloctnpt/public_html/jobifyinc.com/newsite/wp-content/themes/workscout/functions.PHP on line 
740

Notice: Undefined index: emp_dash_redirect in /home/bloctnpt/public_html/jobifyinc.com/newsite/wp- 
content/themes/workscout/functions.PHP on line 742

Notice: Undefined index: login_sub in /home/bloctnpt/public_html/jobifyinc.com/newsite/wp- 
content/themes/workscout/functions.PHP on line 744

这是我的功能文件代码,其中给出上述错误行错误:-

function my_login_redirect( $url,$request,$user ) { 
//   print_r($_POST);
//  echo "kk".$url;
if (current_user_can('administrator')) {\
print_r($_POST); echo "kkkkk"; exit;

$url = admin_url();      
wp_redirect($url);
}
else
{


                 if ($user && is_object($user) && is_a($user,'WP_User')) {
                     $variable_two = $_POST['redirect_tojk'];
                     $variable_submit = $_POST['redirect_to_resume_section'];
  
                     $emp_red_dsbd = $_POST['emp_dash_redirect'];

                     $variable_login = $_POST['login_sub'];

                     if ($user->has_cap('candidate')) {
                         if (!empty($variable_two)) {
                             $url = $_POST['redirect_tojk'];
     
                             wp_redirect($url);
                             exit;
                         }

有关如何处理此问题的任何建议。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)