Download the PHP package whaze/path-of-settings without Composer
On this page you can find all versions of the php package whaze/path-of-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package path-of-settings
PathOfSettings
A modern, developer-friendly WordPress options page builder with React UI and object-oriented architecture.
Overview
PathOfSettings is a comprehensive package for creating custom settings pages in WordPress applications. It provides a clean, object-oriented API for registering pages and fields, with a modern React-based admin interface that integrates seamlessly with WordPress core components.
Key Features
- 🚀 Ultra-Simple API: One-line initialization, no configuration required
- ⚡ Plug & Play: Built assets included, no build step needed
- 🎨 Modern UI: React-powered interface using WordPress Gutenberg components
- 🏗️ Clean Architecture: Object-oriented design with interfaces and services
- 🔌 Flexible Integration: Works in both plugins and themes via Composer
- 🛡️ Type Safety: Full PHP 7.4+ type hints and comprehensive PHPDoc
- 🌐 REST API: Custom endpoints for secure settings management
- 📦 Extensible: Support for custom field types
- 🌍 i18n Ready: Full internationalization support
Installation
Via Composer (Recommended)
That's it! Built assets are included in the package, no additional build step required.
Manual Installation
- Download the latest release from GitHub
- Extract to your plugin or theme directory
- Include the autoloader in your code
Quick Start
🚀 Ultra-Simple Integration
That's it! 🎉 Your settings page is ready with a modern React interface.
🔌 Plugin Integration
🎨 Theme Integration
API Reference
Core Functions
pos_register_page($id, $args)
Register a new settings page.
Parameters:
$id
(string): Unique page identifier$args
(array): Page configurationtitle
(string): Page titlemenu_title
(string): Menu title (optional, defaults to title)capability
(string): Required capability (default:manage_options
)
Returns: PageInterface
object
Example:
pos_add_field($pageId, $type, $id, $args)
Add a field to a settings page.
Parameters:
$pageId
(string): Target page ID$type
(string): Field type (text
,textarea
,select
,checkbox
)$id
(string): Unique field identifier$args
(array): Field configurationlabel
(string): Field labeldescription
(string): Help text (optional)default
(mixed): Default value (optional)required
(bool): Whether field is required (optional)placeholder
(string): Placeholder text (optional)options
(array): Options for select fields (optional)
Returns: FieldInterface
object
pos_get_setting($pageId, $fieldId, $default)
Retrieve a setting value.
Parameters:
$pageId
(string): Page identifier$fieldId
(string): Field identifier$default
(mixed): Default value if not found
Returns: Mixed setting value
Example:
pos_get_settings($pageId)
Retrieve all settings for a page.
Parameters:
$pageId
(string): Page identifier
Returns: Array of all page settings
Field Types
Text Field
Textarea Field
Select Field
Checkbox Field
Advanced Usage
Custom Field Types
Extend the package by creating custom field types:
Advanced Initialization
For advanced use cases, you can pass configuration options:
Hooks and Filters
Actions
pos_register_pages
- Register your settings pagespos_after_save_settings
- Fired after settings are saved
Filters
pos_before_save_settings
- Filter settings before saving
REST API
PathOfSettings automatically creates REST endpoints:
GET /wp-json/pos/v1/settings/{page-id}
- Retrieve settingsPOST /wp-json/pos/v1/settings/{page-id}
- Update settings
Example API usage:
Examples
Complete working examples are available in the /examples
directory:
examples/plugin-example.php
- Full plugin implementationexamples/theme-example.php
- Complete theme integration
Real-World Example: Contact Form Plugin
Requirements
- PHP: 7.4 or higher
- WordPress: 5.8 or higher
- Browser: Modern browser with JavaScript enabled (for admin interface)
Installation Troubleshooting
Common Issues
Assets Not Loading
If the React interface doesn't appear:
- Check browser console for JavaScript errors
- Verify
build/
directory exists in the package - Enable
WP_DEBUG
to see detailed error messages
Permission Issues
If you can't access settings pages:
- Verify user has required capability (
manage_options
by default) - Check if pages are registered correctly
- Ensure
pos_register_pages
action is firing
Composer Issues
If Composer installation fails:
- Update Composer:
composer self-update
- Clear cache:
composer clear-cache
- Try without cache:
composer install --no-cache
Development
For Contributors
Code Standards
Testing
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Development Guidelines
- Follow WordPress coding standards
- Add PHPDoc for all public methods
- Include unit tests for new features
- Update documentation for API changes
- Test in both plugin and theme contexts
Changelog
[1.0.1] - 2025-05-27
- Added: Auto-detection of package assets path
- Added: Simplified initialization API
- Added: Better error handling and debugging
- Improved: Documentation with more examples
- Fixed: Asset loading in theme contexts
[1.0.0] - 2025-05-27
- Initial release
- React-powered admin interface
- Support for text, textarea, select, and checkbox fields
- REST API endpoints
- Composer package support
License
This project is licensed under the GPL-2.0-or-later License. See the LICENSE file for details.
Support
- Issues: GitHub Issues
- Documentation: GitHub Wiki
- Discussions: GitHub Discussions
Credits
Developed by Jerome Buquet (Whaze)
Built with ❤️ for the WordPress community.
Special Thanks
- WordPress Core Team for the excellent Gutenberg components
- The Composer team for making PHP package management awesome
- All contributors and users of this package
Roadmap
Planned Features
- 🎨 Additional field types (color picker, media uploader, date picker)
- 🔗 Field groups and conditional logic
- 📊 Import/export functionality
- 🌐 Multi-site network support
- 🎯 Advanced validation rules
- 🔌 WordPress Customizer integration
- 📱 Better mobile responsive design
Performance Improvements
- ⚡ Field lazy loading
- 💾 Advanced settings caching
- 📦 Asset optimization
- 🗄️ Database optimization
Want to contribute to any of these features? Check out our contributing guide!