Repository navigation
design-settings: reset, export and import for Customizer-backed design - #27
Open
juliacanzani wants to merge 3 commits into
Open
juliacanzani wants to merge 3 commits into
juliacanzani wants to merge 3 commits into
Conversation
… design A module for plugins whose design lives in the Customizer (Design Upgrade Pro for LearnDash, Design Upgrade Pro for H5P, Quiz Customizer), so each gets the same Design tab and an export from one site carries the whole suite's design to another. - register( $plugin, [ options, theme_mods, panel, migrate ] ) and tab( $plugin ) for register_plugin_settings - export: one plugin or all registered, as tangible-design-settings JSON; only registered options/theme mods, never licences - import: upload, review per plugin (applied/skipped, untick), apply. Values are matched to registered Customizer settings and run through their own sanitize/validate; anything else is skipped and listed. A migrate callback sees the raw section first. Apply replaces, not merges. - reset behind a native <dialog>; capability edit_theme_options - forms print from admin_footer (the tab sits inside the framework's own settings form) and controls join them with the form attribute - PHPUnit: export scope, parse, sanitizer pass-through and refusal, migration, replace semantics, reset scope Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…would The review step builds a WP_Customize_Manager outside a Customizer request, and LearnDash's customize_register callback reads the global $wp_customize: get_panel() on null, a fatal on the settings page. Set the global while callbacks run and restore it after; contain a callback that throws, so a broken neighbour can't take the page down. Settings it would have added are absent, so their values are skipped, never written unsanitized, and the review shows a warning with the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p their keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A module for plugins whose design lives in the Customizer: Design Upgrade Pro for LearnDash, Design Upgrade Pro for H5P and Quiz Customizer. Each gets the same Design tab, and an export from one site carries the whole suite's design to another. See
design-settings/readme.md.API
Behaviour
tangible-design-settingsv1 JSON. Only registered options and theme mods are included; licences never are. Empty sections export as{}.sanitize()/validate(), so there's no second allowlist. Anything else is skipped and listed.migratesees the raw section first.<dialog>. The capability isedit_theme_options.admin_footer, because the tab sits inside the framework's settings<form>. Controls join them via theformattribute.$wp_customizeis set whilecustomize_registercallbacks run (LearnDash's reads it), and a throwing callback is contained and reported in the review.20261003(node version.js).Testing
wordpress-developtest image, and in random order three times. One early full run showed 4 failures that I couldn't reproduce in four later runs.🤖 Generated with Claude Code