如何解决我的wordpress插件中的重定向问题?

我正在使用别人开发的自定义wp插件。这个插件允许我们从插件菜单重定向到随机页面/帖子/类别/标签,并且还可以重定向到插件设置选项中预设的特定会员URL。但是,如果我多次单击菜单,则大多数单击会正确重定向,并且很少有重定向无法按预期进行。假设http://localhost/w/cust_redirect/test/是插件菜单链接,如果我单击此链接,它应始终重定向到localhos / wordpress,然后重定向到yahoo.com(会员网址),但最后一个重定向(yahoo.com)在所有情况下均不起作用点击。

<?php defined('ABSPATH') OR die('Direct access Restricted!');
/*
Plugin Name: Custom Redirects Campaign

*/


 if( $post_active == 'Yes' ) {
        $urls = wpcr_cust_get_urls($options);

        if(!$urls){
            wp_redirect(home_url());
            exit;
        }
        $redirect_url = $urls[0];
        $affiliate_url = $urls[1];
        $_SESSION['wpcr_redirect_url_lcd'] = $redirect_url;
        $_SESSION['wpcr_affiliate_url_lcd'] = $affiliate_url;

        wp_redirect($redirect_url); // Redirect to referer link
        exit;
}
   wp_redirect(home_url()); // Cust redirect post is not active for redirection
    exit;
}
}

我希望它始终将菜单链接重定向到url,然后重定向到关联网址。

nothingzz 回答:如何解决我的wordpress插件中的重定向问题?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3139014.html

大家都在问