you are registering two separate settings groups for setting fields & the problem might be here.
function set_options() {
register_setting( 'checkbox-1-settings', 'my_checkbox_1_name' );
register_setting( 'checkbox-2-settings', 'my_checkbox_2_name' );
}
so use only one settings group for both fields to see if it works.
function set_options() {
register_setting( 'checkbox-settings', 'my_checkbox_1_name' );
register_setting( 'checkbox-settings', 'my_checkbox_2_name' );
}
Update
Get settings API and store in an array.
$options = (array) get_option( 'plugin_options' );
Now $options is an array containing all fields sub fields. and you can get the value of any key by just passing that key with this array.
for example to get a value of check_2
$check_two = $options['check_2'];
Related Posts:
- Where can I find a schema of wordpress plugin core architecture?
- How to Loop Plugin Option Field Set?
- How to handel multiple checkbox field in the admin settings page with Settings API
- Custom plugin settings: clicking “save changes” does not display success message
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Where should my plugin POST to?
- Saving Plugin settings to the database
- Plugin development: how to create a form and get custom data?
- shortcode doesn’t work
- Add a Custom Permalink option in the Permalink Admin Screen?
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Wp die causing 500 Internal Server Error?
- Why this global array is returning NULL from a callback function
- How to trigger $_GET request within admin plugin page?
- Custom form action to handle data inside a plugin
- wp_create_nonce function doesn’t work inside a plugin?
- New User Form – Custom Menu Page
- How to get specific setting by settings_fields()?
- Using a custom plugin to capture input data via Ajax and PHP
- Change the display of Settings API (do_settings_sections)
- Settings API saved values not getting shown in the dropdownbox
- Submit Form data to another page via Ajax (WordPress Way)
- Can I use register_settings and unregister_setting once the settings page has loaded?
- Select Form Element Not Saving from Plugin Options
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- How to make sure settings are not lost when plugin is updated?
- How to save Setting pages data to the database?
- User loggedin as Subscriber form not sending
- How to save the option’s new values plus old value without overwrite old one
- submit form data to wordpress existing database table using my plugin
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- How do I add a textarea (multirow) option to my WordPress plugin?
- WP_Filesystem usage within a block of code
- Validating values using Settings API?
- Linking Plugin Files to WP
- Create plugin with form in post and submit it to specific form
- Capturing POST data
- Creating fields in the database
- Undefined variable _POST
- move setting data from wordpress api to codestar freamwork
- Display file contents within Plugin
- When to store store plugin options as a single database record?
- Trying to Find the PHP File/Function that Handles a Specific Form Action URL
- Can a Plugin Override New User Default Role Type
- How to let user store a file in plugin directory but not have it get deleted on update?
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- Plugins ignored a line breaks or tag in the WordPress comment functions
- Create custom pages with a plugin
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- Change letters for day name
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Elementor Custom Control: How to get input value?
- Minimize and Uglify WordPress Plugin Files
- How do I make sure that my plugin only runs on article detail pages?
- WordPress API functions not working at AJAX functions.php call
- How do I show content from a plugin using the template the site is currently working with?
- How to check homepage contain blog post?
- More gentle way to hook WordPress custom url
- Creating a plugin that will display text on every page
- Xamp installed local wordpress not allowing to publish or install plugin
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- Using sessions or an alternative in a plugin
- Correct way to expand custom WordPress plugin functions
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- Update wordpress user roles not working as excepted
- is it possible to fetch data from a remote api while admin is writing a new post?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Can’t access 3rd party API, code works on local server but not on wordpress
- Custom author page for custom role
- Dynamical slug on custom post type
- Storing Array of values into wordpress options
- Using WordPress to create a simple web app (SaaS) [closed]
- WordPress Add advertising ads befor and after content with periority [closed]
- Can plugin automatically update if i hide the update notification?
- woocommerce blank page after clicking add to cart [closed]
- wordpress option page data from select form is not saving to database
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- Apache rewrite rules and wordpress problem
- WordPress automatic plugin update
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- How to list posts that appear in two categories
- Load my plugin before cache
- How to get current template file used by WordPress?
- How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?
- Is it possible to debug plugins with Xcode?
- how to set approval of admin for wordpress posts submitted by the user?
- WordPress Plugin Reviewer
- Plugin to display text before a post
- Can’t edit Contact Us form on front page
- Get all the related data from WordPress DB
- Admin access to WordPress site with installing plugin
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- Plugin to Display Content on Page
- WordPress s2 member plugin not working [closed]
- Why is my activator class adding the files/running the actions I add?
- Can we install 3d product configurator into wordpress
- wp_add_inline_script vs wordpress fetch api
- Woocommerce attatch files and custom input meta to cart items and then to order