0
想要修改我的孩子functions.php
文件以包含一些將Gravity Forms和Ulitmate會員插件連接在一起的邏輯。當用戶訪問我的網站並填寫表單時,我需要捕捉一個隱藏的字段,這些字段會隨其最終成員角色動態填充。我試圖將以下內容添加到我的functions.php
文件中,但它只是使我的網站呈現所有空白頁面。WordPress functions.php語法
add_filter('gform_field_value_um_role', 'getUM_userrole');
function getUM_userrole($value){
$umrole = echo um_user('role_name');
return $umrole;
}
下面是我用的是拿出上面的資源:
http://docs.ultimatemember.com/article/158-umuser
https://www.gravityhelp.com/documentation/article/using-dynamic-population/#hooks
給一個變量指定'echo'? –
取出來?所以我們最終會用'echo um_user('role_name'); return;'? – Tony
不,你不應該給一個變量分配'echo'。含義'$ umrole = echo um_user('role_name');'應該是'$ umrole = um_user('role_name');'。這可能會或可能不會解決實際問題......但它至少會讓你更近一步。 – rnevius