【发布时间】:2011-08-15 17:40:30
【问题描述】:
我的插件表单代码:
function pp_settings_page() {
$pp_options = get_option('pp_options');
?>
<div class="wrap">
<h2>Post Products Settings</h2>
<form action="options.php" method="post">
<?php settings_fields('pp_options_group'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">Currency sign: </th>
<td><input type="text" name="pp_options[currency_sign]" value="<?php echo $pp_options['currency_sign']; ?>" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="Save changes" />
</p>
</form>
</div>
<?php
}
我尝试在模板文件中调用它:
<?php $pp_options=get_option('pp_options');?>
和
<?php get_option('pp_options');?>
我错过了什么?
【问题讨论】:
标签: php forms wordpress plugins