WordPress重定向问题 [英] Wordpress redirect problem

查看:79
本文介绍了WordPress重定向问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是PHP技术的新手..现在我正在使用WORDPRESS ..我有一些基于ROLES重定向到特定URL的问题..我带了一个php页面,并以编程方式创建了一个用户,然后我想将其重定向到特定页面..我正在使用WP_Redirect函数进行重定向..但是我无法找到它,在何处包含此函数,以便进行重定向..pls帮助我..我还是新手...对此WORDPRESS也是如此. .



谢谢

Hi,
i am new to PHP technology..now i am using WORDPRESS..i have some problem of redirecting to specific URL based on ROLES..I took a php page and i created a user programmatically and then i want to redirect it to specific page..I am using WP_Redirect function for redirecting..But i am not able to find it,where to include this function,so that redirection take place..pls help me out..i am newbie...for this WORDPRESS also..



thanks

推荐答案

您的问题尚不清楚,但是我想我可以使用如下代码解决它:
Your question isn''t really clear, but I guess I''d solve it using code like this:
if (current_user_can(''your_role_here'')) { //If the current user has a specific role
     wp_redirect(''http://yoursite.com/yourpage''); //Redirect him. URL must be absolute
}
?>


请尝试提供更多详细信息-我也许能够提供更多见解.


Please try to provide more details - I may be able to provide more insight.


这篇关于WordPress重定向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆