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
- Form submission issue in wordpress admin (custom plugin) using $_GET for searching & filtering
- WP Form Date Field – Remove Day option
- Updating the Drag-To-Share eXtended share URLs?
- finding whether request is for post, and post id
- Building plugin with changeable custom post type values…advice needed
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Anonymous Postings
- How to get all of the activate_plugin action parameters?
- __callStatic method handler passed to add_action causes bug in PHP
- Enqueue WordPress plugin scripts below all other JS
- Display update notification messages like ‘What’s New’
- How to add Internationalization in WordPress using Javascript/React?
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- CRUD and Frontend show from a custom table without shortcode
- Save / Show multi line text in metabox
- Creating mySQL procedure with $wpdb
- how to disable blockrenderAppender inside all Innerblocks?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Redirection of users away from wp-admin (but not administrators)
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Python with wordpress plugin
- Display post lists in 2nd paragraph
- Map Custom Registration Fields to WordPress User Roles
- Not able to add option in Sub-Menu under page
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- Fixing WordPress’s Bug (failed to send buffer of zlib output compression) results in “White Screen of Death”
- Disable woocommerce cookies and delete cart data automatically
- Ajax contact form widget plugin data not insert in database
- link bbpress forum discussion to blogposts
- Install Plugin via Code
- code is working properly in Core PHP but writing coding in WordPress
- Combine scripts from all extensions of the plugin when an extension is activated
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Prevent duplicate records in plugin table
- Send Custom welcome email to specific user group
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- White page by using filter template_include
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- WordPress.org Plugin Directory doesn’t recognise screenshots [closed]
- External CSS in WordPress Plugin [closed]
- How to check current user before all actions and filters?
- Owl Carousel2 image not displaying full width when using Stretch row and content, Stretch row and content(no padding) in wordpress
- User Session and Stored Cookies not get removed
- New databes tables with – WooCommerce – for developers [closed]
- How can I prevent my plugin go development trunk [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- creating html reusable blocks via shortcodes
- Most efficient way to use classes to create admin pages using Settings API
- Add Plugin options as subpage to Theme options page