mirror of
https://gh.wpcy.net/https://github.com/WPTechnix/wp-settings-framework.git
synced 2026-04-27 17:55:57 +08:00
This commit resolves critical bugs in data handling and saving. The
public `get()` method and the tabbed saving mechanism are now reliable.
1. **Corrected `get()` Method:** The internal logic of the `get()` method
has been completely rewritten. It was previously non-functional and
now correctly fetches saved option values from the database, with proper
fallbacks to default values.
2. **Tabbed Saving Fix:** A data loss bug on tabbed pages is resolved.
The `Sanitizer` is now state-aware, merging new input with existing
saved options to ensure settings on other tabs are preserved.
These fixes were made possible by a complete internal refactoring,
which introduced a new `Config` class for state management and enforced
proper dependency injection throughout the framework.
2.9 KiB
2.9 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.0.0] - 2025-08-11
This is the initial public release of the WPTechnix Settings Framework. This version represents a complete architectural overhaul from its internal, monolithic predecessor, refactoring it into a modern, decoupled, and highly extensible framework ready for public use.
Added
- Complete Architectural Refactor: The entire framework has been broken down into small, single-responsibility classes, following modern object-oriented design principles.
- Composer Support: The framework is now fully PSR-4 compliant and installable as a standard Composer package (
wptechnix/wp-settings-framework). - Dependency Injection (DI) Friendly Design:
- Introduced a primary
Settingsclass that acts as a cohesive manager for building a page and retrieving its data. - Added a
Interfaces\SettingsInterfaceto allow for clean dependency injection and testability. - Removed all static accessors (
SettingsRegistry) in favor of an object-oriented, injectable architecture.
- Introduced a primary
- Extensible Field System:
- Created a
FieldFactoryand anAbstractFieldbase class, making it simple to add new, custom field types. - All 20+ field types are now individual classes, making the system easier to maintain and extend.
- Created a
- Dedicated Asset Management: A new
AssetManagerclass now handles all CSS and JavaScript enqueueing. - Intelligent Asset Loading:
- The
AssetManagerautomatically detects which field types are being used and only enqueues the necessary libraries (e.g., Select2, Flatpickr, CodeMirror modes). - Includes a fallback mechanism to prevent conflicts: it will not load a library from its CDN if a theme or another plugin has already registered it.
- The
- Configurable HTML Class Prefixing:
- Introduced a new
htmlPrefixoption (defaults towptechnix-settings) to prevent CSS and JS class name collisions in the WordPress admin. - This prefix is now consistently applied to all custom field elements and their containers.
- Introduced a new
- Flexible
SettingsBuilder:- The
pageTitleandmenuTitleare now optional in theSettingsconstructor, defaulting to WordPress's standard "Settings" text for simpler setups. - Added fluent setter methods (
setPageTitle(),setMenuTitle()) for more flexible configuration.
- The
- Enhanced Code Editor Field: The
codefield now accepts alanguageparameter (css,javascript,html) to enable the correct syntax highlighting mode. - Full PHPDoc Coverage: Every class, method, and property is now fully documented according to PHPDoc and PSR-12 standards.
- Comprehensive
README.mdandCHANGELOG.md: Added official documentation for installation, usage, and project history.