はあなたがadd_option/update_option
save_value_here()
内部機能
を経由して保存する必要が
/* code for adding menu and options in admin */
add_action('admin_menu','admin_menu_adding');
add_action('admin_init','admin_reg_settings');
function admin_menu_adding(){
add_menu_page('Mega Page','Mega Page','administrator','mega-page','settings_page_test');
}
function settings_page_test(){
echo "test";
?>
<form method="post" action="<?php echo admin_url('admin.php'); ?>">
<?php
settings_fields('local-settings');
do_settings_sections('local-settings');
?>
<?php submit_button(); ?>
<input type="hidden" name="action" value="trotbgo" />
</form>
<?php
}
add_action('admin_action_trotbgo','save_value_here');
function save_value_here(){
update_option() //update option goes here
exit;
}
function admin_reg_settings(){
register_setting('local-settings','fieldone');
register_setting('local-settings','fieldtwo');
}
、データベースに値を保存するには、この流れを理解します