Wordpress 提醒用户主题选项已保存?
我正在为我的主题创建一个主题选项页面,我想在用户的选项被保存时提醒他们。知道怎么做吗?下面是我在functions.php代码中使用的代码Wordpress 提醒用户主题选项已保存?,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我正在为我的主题创建一个主题选项页面,我想在用户的选项被保存时提醒他们。知道怎么做吗?下面是我在functions.php代码中使用的代码 function themeoptions_page() { if ( $_POST['update_themeoptions'] == 'true' ) { themeoptions_update(); } ?> <div class="wrap"> <div id="icon-themes" class="i
function themeoptions_page() {
if ( $_POST['update_themeoptions'] == 'true' ) { themeoptions_update(); }
?>
<div class="wrap">
<div id="icon-themes" class="icon32"><br /></div>
<h2>JJTheme Options</h2>
<br><br>
<form method="POST" action="">
<label for="enable-header">
Enable Header Image?
<input type="checkbox" <?php echo (get_option('enableheader')) ? 'checked="checked"' : ''; ?> value="true" id="enable-header" name="enable-header">
</label>
<br><br>
<label for="footer">Footer (HTML Allowed)</label>
<textarea class="large-text code" cols="50" rows="3" name="footer"><?php echo get_option('footer'); ?></textarea>
<br><br>
<label for="ga">Google Analytics Code</label>
<textarea class="large-text code" cols="50" rows="3" name="ga"><?php echo get_option('ga'); ?></textarea>
<br><br>
<input type="submit" value="Save Settings" name="save_menu" class="button-primary menu-save">
<input type="hidden" name="update_themeoptions" value="true">
</form>
</div>
<?php
}
add_action('admin_menu', 'themeoptions_admin_menu');
function themeoptions_update() {
if ($_POST['enable-header'] == 'true') { $header = true; } else { $header = false; }
update_option('enableheader', $header);
update_option('footer', $_POST['footer']);
update_option('ga', $_POST['ga']);
}
函数themeoptions\u page(){
如果($\u POST['update\u themeoptions']='true'){themeoptions\u update();}
?>
JJTheme选项
启用标题图像?
谷歌分析代码
在填写表格之前试试这个。如果有用请告诉我。谢谢
if($_REQUEST['updated'] == 'true') {
echo '<div><p>Theme Options Saved! </p></div>
}
if($\u请求['updated']=='true'){
echo'主题选项已保存
}