0

我正在尝试为我的 Wordpress(Buddypress)网站上的成员找出一种方法来选择他们“最喜欢的电影、书籍等”。

如果成员们可以从系统中已有的书籍中选择,而不是简单地输入这些东西的列表,那将是很好的,并且将来可以根据需要添加更多内容。

我希望有一个简单的答案,例如我可以使用的插件,或者至少可以修改。有谁知道我可以调查的任何事情?

4

1 回答 1

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’ );
于 2013-09-26T09:15:15.340 回答