wordpress-phoenix / wordpress-options-builder-class
Library that helps you setup theme or plugin options that store data in the database with just a line or two of code
Installs: 4 444
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 11
Forks: 7
Open Issues: 5
Requires (Dev)
- automattic/vipwpcs: ^0.4.0
- dealerdirect/phpcodesniffer-composer-installer: ^0.5.0
- wp-coding-standards/wpcs: ^1.2.0
- dev-main
- 5.1.1
- 5.1.0
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.1.9
- 4.1.8
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1
- 3.1.2
- 3.1.1
- 3.1.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 2.0.0-RC1
- 2.0.0-beta-2
- 2.0.0-beta-1
- 1.5.3
- 1.5.2.1
- 1.5.2
- 1.5.1
- 1.5.0
- 1.0.2
- 1.0.1
- dev-update/wpcs-rules
This package is auto-updated.
Last update: 2024-10-25 20:20:04 UTC
README
WordPress options builder class is a library that helps you setup theme or plugin options that store data in the database with just a few lines of code.
Updated in 5.0
- Updated WordPress Coding Standards
- Improved Composer configuration
- Added support for the .editorconfig standard
- Rewrote encryption on the Password field type to use OpenSSL instead of mcrypt
- Removed the Markdown field type
- Refactored library code
Table of Contents
Installation
Composer style (recommended)
- Include in your plugin by creating or adding the following to your composer.json file in the root of the plugin
{ "require": { "WordPress-Phoenix/wordpress-options-builder-class": "^5.0.0" } }
- Confirm that composer is installed in your development enviroment using
which composer
. - Open CLI into your plugins root directory and run
composer install
. - Confirm that it created the vendor folder in your plugin.
- In your plugins main file, near the code where you include other files place the following:
if ( file_exists( dirname( __FILE__ ) . 'vendor/autoload.php' ) ) { include_once dirname( __FILE__ ) . 'vendor/autoload.php'; }
Manual Installation
- Download the most updated copy of this repository from
https://api.github.com/repos/WordPress-Phoenix/wordpress-options-builder-class/zipball
- Extract the zip file, and copy the PHP file into your plugin project.
- Include the
src/class-wordpress-options-panels.php
file in your plugin.
Upgrading to version 5.x
Version 5.0 is a major rewrite of the WordPress Phoenix Options Panel and there are a few required update steps.
- If not using an autoloader, include
src/class-wordpress-options-panels.php
(instead ofwpop-init.php
) - Reference the
\WPOP\V_5_0\*
namespace instead of\WPOP\V_4_1\*
- If you aren't using an autoloader, manually load the class files into memory:
\WPOP\V_5_0\WordPress_Options_Panels::load_files();
- The Markdown field type has been removed; consider switching to
include_partial
and rendering the markdown through a PHP class of your choosing (WordPress Phoenix Options Panel version 4.x used erusev/parsedown) - Update your array of
$args
tonew \WPOP\V_5_0\Page( $args, $fields );
to include aninstalled_dir_uri
key and value, representing the public URL path to your installation of this library (required to load CSS and JS assets used to style the options panels)
Usage
- Get started at the Wiki describing Panel, Section and Part schemas
- See a full example in the WPOP Example Plugin
- Generate a working copy using the WordPress Development Toolkit and the Abstract Plugin Base.