Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 重定向Buddypress的编辑配置文件页面_Php_Wordpress_Redirect_Buddypress - Fatal编程技术网

Php 重定向Buddypress的编辑配置文件页面

Php 重定向Buddypress的编辑配置文件页面,php,wordpress,redirect,buddypress,Php,Wordpress,Redirect,Buddypress,我的客户正在他的Wordpress网站上使用Buddypress,但他不希望用户在Buddypress中编辑他们的个人资料 他也不希望用户在点击管理员栏时进入他们的/profile/edit页面 因此,我正在寻找一种方法,将de adminbar中的url更改为纵断面图页面,或者将profile/edit页面重定向到纵断面图页面 因此,来自: 致: 关于如何实现这一点有什么想法吗?我用以下代码解决了这个问题: <?php $classes = get_body_class(); i

我的客户正在他的Wordpress网站上使用Buddypress,但他不希望用户在Buddypress中编辑他们的个人资料

他也不希望用户在点击管理员栏时进入他们的
/profile/edit
页面

因此,我正在寻找一种方法,将de adminbar中的url更改为纵断面图页面,或者将
profile/edit
页面重定向到纵断面图页面

因此,来自:

致:


关于如何实现这一点有什么想法吗?

我用以下代码解决了这个问题:

<?php $classes = get_body_class();

   if (in_array('profile-edit',$classes)) {     
       wp_redirect( bp_loggedin_user_domain() ); exit;
    };

?>

此代码调用主体的类。如果body类中有“profile edit”,则调用wp_重定向函数。此函数请求BuddyPress loggedin用户配置文件页面的url,并将其发送到该页面