我有这个基本的管理页面
功能。php
<?php include(\'ui.php\'); ?>
用户界面。php
<?php
function gui()
{
include(\'gui.php\');
}
function add_page()
{
$themename = \'Cesaro\';
$page_function = \'gui\';
add_menu_page( $themename." Options", $themename, \'edit_themes\', $page_function, \'gui\' );
}
add_action( \'admin_menu\', \'add_page\' );
?>
gui。php
<form name="input" action="post_options_from_form.php" method="post">
<article>
<label>Firstname</label><input type="text" class="x-input"/>
</article>
<article>
<label>Lastname</label><input type="text" class="x-input"/>
</article>
<article>
<label>City</label><input type="text" class="x-input"/>
</article>
<input type="submit" value="Update Options" class="x-button"/>
</form>
当我单击“更新选项”时,会出现错误
The requested URL /wp-admin/post_options_from_form.php was not found on this server.
如何确保post值以我在post操作中指定的php结尾?。我的post php文件是
post_options_from_form.php
SO网友:Gandalf
我是这样解决的
<form name="input" action="<?php echo get_bloginfo( \'template_directory\' ).\'/\'.\'post_options_from_form.php\'; ?>" method="post">
虽然我想从表单中获得post\\u options\\u。php是一个管理页面。
编辑:
这最终起到了作用,因为我可以发布到我创建的管理页面
<form name="input" action="admin.php?page=admin_page" method="post">
在函数上,
function admin_page()
{
require(\'post_options_from_form.php\');
}