php - How to delete settings in Wordpress on plugin uninstall? -


i'm developing first wordpress plugin , register plugin settings on admin_init hook:

register_setting( 'option_group', 'option_name', 'sanitize_callback' ); 

it works, great. on deactivating (register_deactivation_hook) set:

unregister_setting( 'option_group', 'option_name' ); 

it works. how delete settings on plugin uninstall? when put

delete_option( 'option_name' ); 

in uninstall.php can't delete plugin plugins page (wp shows "deletion failed: sure want this? please try again." notification). why?

fixed. 1 of security checks used interfere delete_option:

check_admin_referer 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -