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:
- How to export comments in WordPress?
- How can I call a function from one plugin within another plugin?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Publish author posts only with editor approval?
- Replacing Icons in the Dashboard
- Keep one user logged for a year?
- Customizing subject in comment notification e-mails
- WP showing “warning: call_user_func_array()”, What to do?
- Declare a function before plugin does on the theme functions.php file
- Generate Advanced Custom Fields box in custom admin menu page
- Removing user contact methods works from functions.php but not from a plugin
- Execute a function using ajax
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Use functionality of 2 wordpress plugins
- Fatal error: Class not found in
- What’s the point of using WordPress’s built in admin-ajax.php?
- How can i change an image’s author?
- Converting a simple plugin to be placed inside of functions.php
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Showing Co-Authors on post page
- jQuery Plugin to use WordPress functions in AJAX request
- Using plugin functionality in external php script not working
- greatest() function returns undefined property
- Debugging Technique Question re: functions.php
- Override plugin with functions.php
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- How to include code into functions.php file via a plugin
- Custom Taxonomy Tag Search
- Missing argument 3 for wp_register_sidebar_widget()
- Redeclare theme’s function in a plugin
- I have functions in my wordpress plugin. How do I get them to work for me?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Shortcode button dosent work for all posts. Work for first post only
- Is there a way I can find wordpress posts that don’t contain a word?
- Prevent shortcode from being wrapped in tags
- Change wordpress current_time function to different timezone
- How to override a plugin function wrapped in a class?
- Edit Yoast SEO breadcrumbs output [closed]
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Using a post-signup hook to get user details
- Restrict media upload size by format
- Calling plugin function inside custom plugin for onclick event
- Show function to super admin
- Facebook Messager Plugin
- Grab WordPress Salt Data From URL
- Cannot get wpdb data (Error in a simple fuction) [closed]
- Help with WP Business Directory Manager Plugin?
- wp_dequeue_script for a Plugin
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- Loading a plugin’s js file from functions.php
- Overriding an Array in a Plugin’s Class/Function from functions.php
- How to access OOP plugin function inside themes or other plugin
- Different registration form for different roles
- Can you echo PHP code from a variable?
- Elementor Pro display featured image on section -> style -> image using shortcode
- Dynamic URL Rewrite for Custom
- Create a pdf from the entries in DB
- RSS feeds for specific topics
- add_rewrite_rule to load different page, without changing URL in browser
- Error using wordpress functions inside a plugin class
- Share my WordPress plugin for updating how?
- Overriding a function in a WordPress plugin
- Submitting form to PHP
- Adding discount functionality to the cart
- Precheck fields when I add a new post
- How to detect 404 url and make this link underline or change background color?
- Get Shortcode output to database for static post_content
- working code, not working – Plugin Dev
- Use buddypress function outside of plugin
- How use get_plugin_updates() function?
- how override a define
- How to Unhook actions/filters in within Class in plugin
- WPML – Hook when language is switched (change user language)
- Use action, filter, or hook to append HTML to WordPress plugin function
- Change custom rewrite rule when permalink is updated/changed
- Configuring default woo commerce login with modal popup
- Save Post Permalink In .txt File
- Dynamically Modify s2member Options
- How To Add Code To WP Without Plugin or Functions
- My ajax request don´t work and return 0
- Disqus comments count taking long to update
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Home page letters
- Find all strings between an enclosing shortcode
- Create csv file in plugin
- How do add_action and WP_Query
- Trying to output a “Most visited blogs” list in wordpress multisite
- wordpress Search function is not working
- Adding a script & php to functions.php
- Override the plugin class and function
- Activate and deactivate two plugins automatically at certain hours
- PHP Creating a formula from mysql db values and db stored math operator
- 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?
- 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