2013-08-06 31 views
0

我試圖找出會員的方式在我的WordPress(BuddyPress的)現場挑選自己「最喜歡的電影,書籍等。」添加用戶配置文件字段WordPress的BuddyPress的包括「收藏夾」

這將是很好的,如果,不是會員只需鍵入這些事情的清單,他們可以從書本已經在系統中進行選擇,並添加更多的,請在未來。

我希望有一個簡單的答案,比如一個插件,我可以使用,或者,至少,修改。有人知道我可以看到的任何東西嗎?

回答

1

你的標題問如何添加用戶配置文件字段。這裏是代碼添加儘可能多的字段,只要你喜歡。一旦你添加字段,您可以輕鬆地將自定義選項卡頁面上的其他輸入或選擇讓用戶輸入自己的最愛。

function my_test_setup_nav() { 
global $bp; 
$parent_slug = ‘test’; 
$child_slug = ‘test_sub’; 
//name, slug, screen, position, default subnav 
bp_core_new_nav_item(array(‘name’ => __(‘Test’),’slug’ => $parent_slug,’screen_function’ => ‘my_profile_page_function_to_show_screen’,'position’ => 40,’default_subnav_slug’ => $child_slug)); 
/* Add the subnav items to the profile */ 
// name, slug, parent_url, parent slug, screen function 
bp_core_new_subnav_item(array(‘name’ => __(‘Home’), ‘slug’ => $child_slug, ‘parent_url’ => $bp->loggedin_user->domain . $parent_slug.’/', ‘parent_slug’ => $parent_slug, ‘screen_function’ => ‘my_profile_page_function_to_show_screen’)); 
bp_core_new_subnav_item(array(‘name’ => __(‘Random Page’), ‘slug’ => ‘random’, ‘parent_url’ => $bp->loggedin_user->domain . $parent_slug.’/', ‘parent_slug’ => $parent_slug, ‘screen_function’ => ‘my_profile_page_function_to_show_screen234′)); 
} 

function my_profile_page_function_to_show_screen() { 

//add title and content here – last is to call the members plugin.php template 
add_action(‘bp_template_title’, ‘my_profile_page_function_to_show_screen_title’); 
add_action(‘bp_template_content’, ‘my_profile_page_function_to_show_screen_content’); 
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘members/single/plugins’)); 
} 

function my_profile_page_function_to_show_screen_title() { 
echo ‘wptaskforce title’; 
} 

function my_profile_page_function_to_show_screen_content() { 
echo ‘wptaskforce content’; 
} 


//random page content: 
function my_profile_page_function_to_show_screen234() { 
//add content here – last is to call the members plugin.php template 
add_action(‘bp_template_content’, ‘my_profile_page_function_to_show_screen234_content’); 
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘members/single/plugins’)); 
} 
function my_profile_page_function_to_show_screen234_content() { 
echo ‘This is a random page.’; 

} 
add_action(‘bp_setup_nav’, ‘my_test_setup_nav’); 
+0

您正在使用back ticks('''')而不是單引號('''),所以這會產生很多語法錯誤。 –

相關問題