簡體   English   中英

重定向Buddypress的編輯個人資料頁面

[英]Redirect the edit profile page of Buddypress

我的客戶在他的Wordpress網站上使用Buddypress ,但他不希望用戶在Buddypress中編輯其個人資料。

此外,他不希望用戶去他們/profile/editadminbar當點擊頁面。

因此,我正在尋找一種方法,可以將adminbar中的url更改為個人資料視圖頁面,或者將profile/edit頁面重定向到profile/edit資料視圖頁面的方法。

因此,來自: http:// [網站網址] / members / [用戶名] / profile / edit /

收件人: http:// [網站網址] / members / [用戶名] /

關於如何實現這一目標的任何想法?

我用以下代碼解決了這個問題:

<?php $classes = get_body_class();

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

?>

此代碼稱為主體類。 如果主體類中包含“ profile-edit”,則將調用wp_redirect函數。 該功能要求BuddyPress登錄的用戶個人資料頁面的URL,並將其發送到該頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM