Wordpress - updating plugin option on click by admin -


i trying simple - trying create notice admin of website using plugin. alongside, want provide option dismiss notice in case not want see anymore.

i cannot figure out. below code - everytime click on button, gives me thw wordpress error "are sure want this"..

ay help/example awesome!

#

div class="plugin_admin_notice notice notice-warning is-dismissible"> <p><?php _e('<form action="options.php" method="post"><input type="hidden" name="option_page" value="plugin_options" /><input type="hidden" name="action" value="update" /><input type="hidden" id="_wpnonce" name="_wpnonce" value='. wp_create_nonce( 'add_option' ) .' /><input type="hidden" name="_wp_http_referer" value="/wp-admin/options-general.php?page=plugin" /><input type="text" name="plugin-notice" value="1"><input name="submit" type="submit" value="dont show anymore"></form>', 'plugin_textdomain'); 

?>

#

any idea whatis wrong - have feeling wp_create_nonce, not sure.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -