You could make another function with will (re)set the default option values:
function wpse_91307_set_option_defaults() {
$options = array(
'ptechsolcopy_notice' => 'Copyright ©',
'ptechsolcopy_reserved' => 'All Rights Reserved'
);
foreach ( $options as $option => $default_value ) {
if ( ! get_option( $option ) ) {
add_option( $option, $default_value );
} else {
update_option( $option, $default_value );
}
}
}
Then you could change your set_copyright_options() function into this:
function set_copyright_options() {
delete_option( 'ptechsolcopy_notice' );
delete_option( 'ptechsolcopy_reserved' );
wpse_91307_set_option_defaults( );
}
When you hit the reset button, the only thing you have to do is execute the wpse_91307_set_option_defaults() function.
Related Posts:
- Disable plugin / plugin action via theme
- Need to create a Theme demo site that features multiple themes
- Why does including a file in theme’s functions.php not work?
- Adding New Role
- Add Top-Level Menu that opens URL
- wordpress custom login successful redirect hook
- WordPress ajax call for not logged in users, doesn’t work
- Display All Non-Used Plugins
- New Plugin: Post update pushes a copy as a revision
- Placement of Code in Plugin for hooking `save_post`
- Add get_option to jquery
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Using a function to change favorites listing
- WP Query. Is there a maximum size?
- How to set Noindex to all wordpress pages in a catergory?
- Load Javascript from Plugin in One Page Only?
- Plugin is a widget, but I want to call it in the head, can I?
- Cannot get wpdb data (Error in a simple fuction) [closed]
- How to keep variable `$post` to using in another file
- Plugin Development – Functions or Hooks?
- wp_dequeue_script for a Plugin
- Need to replace Currency Shortforms
- wc_get_template new template does not showing up
- add_query_arg not work in admin
- Overriding an Array in a Plugin’s Class/Function from functions.php
- How do I create a custom permalink structure for a page template
- How to remove a class function from a plugin by using remove_action()?
- Api external with wordpress
- Change Header (Logo) Based on Login
- Hook for altering the content of all wp mails
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Sharing functions between plugins
- How can i list random author?
- Can you echo PHP code from a variable?
- Defining the value of a variable before a function?
- How to get custom minimum price in Woocommerce
- Dynamic URL Rewrite for Custom
- how to validate input field in wordpress generated with wpform plugin
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- Error using wordpress functions inside a plugin class
- How to copy the all WordPress media items to another custom plugin folder?
- Share my WordPress plugin for updating how?
- The function called on the wp head hook becomes null
- Submitting form to PHP
- How to detect 404 url and make this link underline or change background color?
- Make modification of add_to_cart button specific to single page
- working code, not working – Plugin Dev
- How use get_plugin_updates() function?
- how override a define
- how can export data in excel file custom plugin
- How to Unhook actions/filters in within Class in plugin
- How to disable/enable a plugin at a specific time
- WP_CRON issue with UTC and local time
- Configuring default woo commerce login with modal popup
- How to wrap image tag into div for post only?
- Update User Meta Via Ajax
- Dynamically Modify s2member Options
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- How to delete posts older than one year with post meta, post attachments and files?
- Unexpected plugin_dir_path Output
- how to create table during plugin installation in side a class
- Create csv file in plugin
- Posting code inside the post instead of in the template file using shortcode
- Load wordpress enviroment for external content?
- Metabox Data not saving
- How do add_action and WP_Query
- How to structure plugin in to functions?
- Can’t get custom user meta to show in header
- Including a PHP file via a function that is part of a plugin?
- Pass strings to plugin function [closed]
- How to disable register and reset the password from WordPress admin panel?
- How to tweak a plugin without preventing it from updating
- WP Members additional fields on user profile [closed]
- What is wrong with this dbDelta syntax?
- Call a function with href
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Adding a script & php to functions.php
- Override the plugin class and function
- Activate and deactivate two plugins automatically at certain hours
- How to Allow Users to Select Recipients In a WordPress Comment section?
- How often should I execute add_filter and function declaration in Code Snippets?
- Product customizing quiz – quiz adding products to the cart
- How to change all the urls of the WordPress site?
- Show WooCommerce products based on query parameters on redirect
- Event Made Easy – Block registration to two or more events that have the same category
- I want to allow certain file types on dokan upload files
- Secure way to add JS Script to WordPress filesystem
- How to access a function declared in child theme’s functions file in a plugin file?
- Re-use date format on different template
- Remove and strip html tag values