Settings: YAML-based config pages#40
Open
titus-toia wants to merge 2 commits into
Open
Conversation
The SettingsRenderer nests field names under the settings slug (e.g., settings_slug[field_name]), but extract_post_data() was looking for flat $_POST[field_name]. Values were silently skipped on every save, resulting in empty settings. Check $_POST[slug][field_name] first, fall back to flat for compat. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Integrates the YAML-based settings/config-pages feature, rebased onto current
main.Lets a plugin register a full settings page from a YAML file:
Adds:
src/Settings/YamlSettingsLoader.php— parses the YAML and builds a singular DataView (tabs, sections, fields).src/Settings/SettingsRenderer.php— renders the page in the framework's settings layout (tabs/nav, form-table fields, submit).src/Settings/YamlFieldMapper.php— maps YAML field types → DataView + Tangible Fields config.src/Settings/index.php— globaltangible_object_register_settings()entry point (registered via composerfilesautoload).composer— addssymfony/yaml ^7.0.RequestRouter::extract_post_data()— reads nested$_POST[settings_slug][field]first (settings/singular mode), falling back to flat POST.Rebase note
This was previously on
settings-api, ~3.5 months stale (last touched 2026-02-16) and 13 commits behindmain. Rebased onto currentmain(which includes the late-May RequestRouter / POST-forms / nonce refactor, #34–38). Two commits, replayed cleanly:yaml based configFix settings save: extract nested POST data from settings keyThe only
main-overlapping change isextract_post_data(), which still targets a method present post-refactor and applied without conflict. The newSettings/*files are clean additions.Testing
PHP lint passes on all rebased files. The WP integration test suite (
tests/phpunit) requires awordpress-developharness not available locally — relying on CI to validate against the refactor.