|
2 | 2 |
|
3 | 3 | 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. |
4 | 4 |
|
5 | | -### Updated in 4.1 |
6 | | -* Fully escaped & sanitized |
7 | | -* More data storage APIs |
8 | | -* Cleaned up styles |
9 | | -* Improved Media field |
10 | | -* Cruft cleanup |
11 | | -* Inline docblocks |
12 | | -* ... and much more! |
| 5 | +### Updated in 5.0 |
| 6 | + |
| 7 | +* Updated WordPress Coding Standards |
| 8 | +* Improved Composer configuration |
| 9 | +* Added support for the [.editorconfig standard](https://editorconfig.org) |
| 10 | +* Rewrote encryption on the Password field type to use OpenSSL instead of mcrypt |
| 11 | +* Removed the Markdown field type |
| 12 | +* Refactored library code |
13 | 13 |
|
14 | 14 | Builds protected by CircleCI: [](https://circleci.com/gh/WordPress-Phoenix/wordpress-options-builder-class) |
15 | 15 |
|
16 | | -## Table of Contents: |
17 | | -- [Installation](#installation) |
18 | | -- [Usage](#usage) |
| 16 | +## Table of Contents |
| 17 | + |
| 18 | +* [Installation](#installation) |
| 19 | +* [Upgrading to version 5.x](#upgrading-to-version-5x) |
| 20 | +* [Usage](#usage) |
| 21 | + |
| 22 | +## Installation |
| 23 | + |
| 24 | +### Composer style (recommended) |
19 | 25 |
|
| 26 | +1. Include in your plugin by creating or adding the following to your composer.json file in the root of the plugin |
| 27 | + ```json |
| 28 | + { |
| 29 | + "require": { |
| 30 | + "WordPress-Phoenix/wordpress-options-builder-class": "^5.0.0" |
| 31 | + } |
| 32 | + } |
| 33 | + ``` |
| 34 | +2. Confirm that composer is installed in your development enviroment using `which composer`. |
| 35 | +3. Open CLI into your plugins root directory and run `composer install`. |
| 36 | +4. Confirm that it created the vendor folder in your plugin. |
| 37 | +5. In your plugins main file, near the code where you include other files place the following: |
| 38 | + ```php |
| 39 | + if ( file_exists( dirname( __FILE__ ) . 'vendor/autoload.php' ) ) { |
| 40 | + include_once dirname( __FILE__ ) . 'vendor/autoload.php'; |
| 41 | + } |
| 42 | + ``` |
20 | 43 |
|
21 | | -# Installation |
| 44 | +### Manual Installation |
22 | 45 |
|
23 | | -## Composer style (recommended) |
| 46 | +1. Download the most updated copy of this repository from `https://api.github.com/repos/WordPress-Phoenix/wordpress-options-builder-class/zipball` |
| 47 | +2. Extract the zip file, and copy the PHP file into your plugin project. |
| 48 | +3. Include the `src/class-wordpress-options-panels.php` file in your plugin. |
24 | 49 |
|
25 | | -1. Include in your plugin by creating or adding the following to your composer.json file in the root of the plugin |
26 | | -```json |
27 | | -{ |
28 | | - "require": { |
29 | | - "WordPress-Phoenix/wordpress-options-builder-class": "3.*" |
30 | | - } |
31 | | -} |
32 | | -``` |
33 | | -2. Confirm that composer is installed in your development enviroment using `which composer`. |
34 | | -3. Open CLI into your plugins root directory and run `composer install`. |
35 | | -4. Confirm that it created the vendor folder in your plugin. |
36 | | -5. In your plugins main file, near the code where you include other files place the following: |
37 | | -```php |
38 | | -if( file_exists( dirname( __FILE__ ) . 'vendor/autoload.php' ) ) { |
39 | | - include_once dirname( __FILE__ ) . 'vendor/autoload.php'; |
40 | | -} |
41 | | -``` |
| 50 | +## Upgrading to version 5.x |
42 | 51 |
|
43 | | -## Manual Installation |
44 | | -1. Download the most updated copy of this repository from `https://api.github.com/repos/WordPress-Phoenix/wordpress-options-builder-class/zipball` |
45 | | -2. Extract the zip file, and copy the PHP file into your plugin project. |
46 | | -3. Use SSI (Server Side Includes) to include the file into your plugin. |
| 52 | +Version 5.0 is a major rewrite of the WordPress Phoenix Options Panel and there are a few required update steps. |
47 | 53 |
|
48 | | -# Usage |
| 54 | +* If not using an autoloader, include `src/class-wordpress-options-panels.php` (instead of `wpop-init.php`) |
| 55 | +* Reference the `\WPOP\V_5_0\*` namespace instead of `\WPOP\V_4_1\*` |
| 56 | +* If you aren't using an autoloader, manually load the class files into memory: |
| 57 | + ```php |
| 58 | + \WPOP\V_5_0\WordPress_Options_Panels::load_files(); |
| 59 | + ``` |
| 60 | +* 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](https://packagist.org/packages/erusev/parsedown)) |
| 61 | +* Update your array of `$args` to `new \WPOP\V_5_0\Page( $args, $fields );` to include an `installed_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) |
49 | 62 |
|
50 | | -* [Get started](https://github.com/WordPress-Phoenix/wordpress-options-builder-class/wiki) at the Wiki describing Panel, Section and Part schemas |
51 | | -* [See a full example](https://github.com/WordPress-Phoenix/wpop-example-panel/blob/master/app/admin/class-options-panel.php) in the WPOP Example Plugin |
52 | | -* [Generate a working copy](https://github.com/WordPress-Phoenix/wordpress-development-toolkit/releases) using the WordPress Development Toolkit and the [Abstract Plugin Base](https://github.com/WordPress-Phoenix/abstract-plugin-base). |
| 63 | +## Usage |
53 | 64 |
|
| 65 | +* [Get started](https://github.com/WordPress-Phoenix/wordpress-options-builder-class/wiki) at the Wiki describing Panel, Section and Part schemas |
| 66 | +* [See a full example](https://github.com/WordPress-Phoenix/wpop-example-panel/blob/master/app/admin/class-options-panel.php) in the WPOP Example Plugin |
| 67 | +* [Generate a working copy](https://github.com/WordPress-Phoenix/wordpress-development-toolkit/releases) using the WordPress Development Toolkit and the [Abstract Plugin Base](https://github.com/WordPress-Phoenix/abstract-plugin-base). |
0 commit comments