0
您好我想使用的功能,我得到這個錯誤功能顯示錯誤
Parse error: syntax error, unexpected 'function' (T_FUNCTION) on line 3
連接
<?php
add_action('admin_menu', 'zkr_my_theme_menu_first'); // we need this action to create the menu
// this makes the menu
function zkr_my_theme_menu_first()
{
$page_title = "Theme Settings";
$menu_title = "Theme Settings";
$capability = "administrator";
$menu_slug = "zkr-theme-settings";
$function = "zkr_main_theme_menu";
$icon_url = get_template_directory_uri() . "/zkrframework/images/settings_icon.gif";
add_menu_page($page_title,$menu_title,$capability,$menu_slug, $function, $icon_url);
}
// this shows the menu html think of it as the view.
function zkr_main_theme_menu()
{
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
if (!user_can($user_id, 'create_users'))
return false;
?>
<div class="wrap">
<h2>Hello Menu</h2>
</div>
<?php
}
?>
我想菜單添加到我的WordPress管理面板的代碼我得到這個錯誤
我該如何解決這個錯誤?
在這一刻我測試你的代碼,結果是好的。請再試一次。 – 2014-08-29 20:10:05