Hi,
I’m trying to update order_email_to from a custom admin page. But no way.
I created a new plugin to add an admin page with add_menu_page
function test_plugin_setup_menu(){
add_menu_page( 'Email', 'Email', 'contributor', 'test-plugin', 'test_init' );
}
add_action('admin_menu', 'test_plugin_setup_menu');
function test_init(){
save_my_email();
}
function save_my_email(){
$options=get_option('wppizza');
echo 'MY EMAIL '.$options['order']['order_email_to'][0];
$options['order']['order_email_to'][0]='[email protected]';
$go=update_option('wppizza', $options);
if($go==false){
echo 'false';
}else{
echo 'yes';
}
}
//If I do save_my_email() outside test_init(), it's ok.
//save_my_email()
But the result is always FALSE, the option isn’t saved. Impossible to solved this problem.
Why … What’s wrong ?
Thanks
Nicolas