0
如何讓我的新sub_nav項目正確顯示我創建的屏幕?BuddyPress新的sub_nav項目和屏幕
我正在使用我自己的兒童主題。我試圖完成的是讓我的用戶能夠爲他們的孩子創建子賬戶。我有單獨的功能,它的工作正常。
工作原理: 「子帳戶」選項卡按預期顯示。
發生了什麼事 單擊時,出現404錯誤。
我有一個文件夾BP-主題/ BP-默認/件/單/兒童
我缺少的是一個孩子account.php?
這裏是我的代碼:
add_action('bp_setup_nav', 'add_subnav_items', 100);
function add_subnav_items() {
global $bp;
//Child Account(s) tab
$tab_array['name'] = 'Child Account(s)';
$tab_array['link'] = $bp->displayed_user->domain.'child';
$tab_array['slug'] = 'child';
$tab_array['parent_url'] = $bp->displayed_user->domain;
$tab_array['parent_slug'] = bp_core_get_userlink(bp_loggedin_user_id());
$tab_array['css_id'] = 'child';
$tab_array['position'] = 100;
$tab_array['user_has_access'] = '1';
$tab_array['screen_function'] = 'profile_screen_child_account';
$bp->bp_nav['child'] = $tab_array;
}// End add_subnav_items
function profile_screen_child_account() {
add_action('bp_template_content', 'profile_screen_child_account_show');
bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
}// End profile_screen_child_account
function profile_screen_child_account_show() {
echo "Manage Child Account Screen";
locate_template(array('child-template.php'), true);
}// End profile_screen_child_account_show