Skip to content

Let WP_SCSS_OPTIONS in wp-config.php override the saved settings - #282

Merged
shadoath merged 2 commits into
masterfrom
feature/options-constant
Nov 3, 2026
Merged

shadoath merged 2 commits into
masterfrom
feature/options-constant

Conversation

@shadoath

@shadoath shadoath commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Done when: with define('WP_SCSS_OPTIONS', array('base_compiling_folder' => 'Current Theme', 'scss_dir' => '/scss', 'css_dir' => '/css', …)) in wp-config.php and no wpscss_options row in the database, the front page compiles and enqueues the CSS, and the settings page names the overridden keys. Checked in Docker (WP 7.1.4, PHP 8.4), along with a partial override (only compiling_options) layered over saved settings, always_recompile => true and enqueue => false.
  • Fixes Configure plugin via define or json #222: the settings could only live in the database, so they couldn't be versioned or set per environment from code. A filter in a theme wasn't an option either: the plugin reads its settings when it loads, before the theme runs. The constant is merged over the saved option. It adds the trailing slash the settings form would add, accepts true/false for the two checkboxes (the compiler checks for the string '1'), and runs through the existing Leafo-name cleanup, so the old snippet from the issue thread still works.
  • How this could fail: the form fields still show the database values for any key the constant overrides. An admin who edits one and saves sees "Settings saved" and nothing changes. The warning above the form names those keys, so it's visible, but someone who doesn't read it could be confused.

🤖 Generated with Claude Code

shadoath and others added 2 commits November 2, 2026 19:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shadoath

shadoath commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@shadoath
shadoath merged commit d225a66 into master Nov 3, 2026
@shadoath
shadoath deleted the feature/options-constant branch November 3, 2026 02:49
@shadoath shadoath mentioned this pull request Nov 3, 2026
shadoath added a commit that referenced this pull request Nov 3, 2026
* Version bump to 5.1.0

Ships the Compile Now button and deploy webhook (#281), the WP_SCSS_OPTIONS wp-config override (#282), the File sourcemap fix (#280) and the unreadable-directory fatal fix (#279). Updates the version in wp-scss.php, the readme.txt Stable tag, and adds the 5.1.0 changelog entry to readme.txt and readme.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove the looking-for-a-maintainer notice from both readmes

Issue #242 is closed; the plugin is actively maintained again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure plugin via define or json

1 participant