2

All of my theme's custom options are preceeded with "mytheme_" + option.

For example, mytheme_color1, mytheme_color2, mytheme_body_font_color, etc...

I'd like to create a plugin that uninstalls all of the items in wp_options where the option is preceeded with "mytheme_"

If you have a reference or example, please share it. Thanks in advance :-)

2

All of my theme's custom options are preceeded with "mytheme_" + option.

Not safe enough. Use set_theme_mod(), get_theme_mod() and remove_theme_mod() instead. You’ll find these and more related functions in wp-includes/theme.php.

1

DELETE FROM $wpdb->options WHERE option_name LIKE 'mytheme%'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.