我正在尝试为wordpress开发一个插件。一切正常,但是当我通过URL传递参数时,我会说:
You do not have sufficient permissions to access this page.下面是我的代码:
<?php add_action('admin_menu', 'theme_options_add_pages');
function theme_options_add_pages() {
add_menu_page('Theme Options', 'Theme Options', 1, __FILE__, 'main_page');
}
function main_page() { ?>
<div id="theme-options-container">
<form>
<div id="theme-options-header">
<img id="theme-options-logo" src="../wp-content/plugins/theme-options/images/wordpress-logo-hoz-rgb.png" alt="Your logo here"/>
</div>
<div id="theme-options-clear">
<div id="theme-options-sidebar">
<div class="shadow"></div>
<ul role="navigation">
<li id="theme-option-general">
<a href="#"><div class="theme-option-image"></div>General Settings</a>
</li>
<li id="theme-option-styles">
<a href="#"><div class="theme-option-image"></div>Styling Options</a>
</li>
</ul>
</div>
<div id="theme-options-content"></div>
</div>
</form>
</div>
<?php }有人知道我为什么会得到这个错误吗?谢谢
发布于 2013-04-17 00:04:24
您需要指定一个功能和一个插件:
add_menu_page( 'Theme Options', 'Theme Options', 'manage_options', 'my-theme-options', 'main_page' );
http://codex.wordpress.org/Function_Reference/add_menu_page
https://stackoverflow.com/questions/16000487
复制相似问题