Skip to content

Commit

Permalink
Merge pull request #12 from WordPress-Phoenix/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
0aveRyan authored Jan 29, 2018
2 parents 5b89d1c + 5fd298b commit bdcbecd
Show file tree
Hide file tree
Showing 5 changed files with 1,565 additions and 1,213 deletions.
58 changes: 1 addition & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Builds protected by CircleCI: [![CircleCI](https://circleci.com/gh/WordPress-Pho
```json
{
"require": {
"WordPress-Phoenix/wordpress-options-builder-class": "1.*"
"WordPress-Phoenix/wordpress-options-builder-class": "3.*"
}
}
```
Expand All @@ -38,60 +38,4 @@ if( file_exists( dirname( __FILE__ ) . 'vendor/autoload.php' ) ) {

# Usage

### WARNING: This documentation isn't yet current to v2 -- coming soon!

## Site Options Page
The following is example code which can be run to create a very basic site options page. You can use standard OOP principals shown in the below code to expand upon the sample. Please read through the class names in the library to find all the different types of fields you can include into your options page, or build your own field types by extending the existing classes.

```php
$this->site_options_page = new sm_options_page( array (
'parent_id' => 'themes.php',
'id' => 'custom-options',
'page_title' => 'Custom Settings',
'menu_title' => 'Settings',
) );
$this->site_options_page->add_part($section = new sm_section('branding_options', array('title'=>'Branding')) );
$section->add_part( $cpt_header_background = new sm_media_upload( 'cpt_header_bg_image', array(
'label' => 'Header Background Image',
'description' => 'Background image to be used in the header on the Custom archive page.'
) ) );
$section->add_part( $cpt_header_logo = new sm_textfield( 'cpt_header_logo', array(
'label' => 'Header Logo',
'description' => 'Logo to be used in the header on the Custom archive page.'
) ) );
$section->add_part( $cpt_description = new sm_textarea( 'cpt_description', array(
'label' => 'Custom Description',
'value' => 'Custom Description',
'description' => 'Description to be used in the header on the Custom archive page.',
) ) );
$section->add_part( $cpt_color_overlay = new sm_color_picker( 'cpt_color_overlay', array(
'label' => 'Custom Color Overlay',
'value' => 'Custom Color Overlay',
'description' => 'Color overlay to be used over header image only on the Custom archive page.',
) ) );
$section->add_part( $cpt_coming_soon_header = new sm_media_upload( 'cpt_coming_soon_header', array(
'label' => 'Custom Coming Soon Header Image',
'description' => 'Header image to be used on Custom Coming Soon page.'
) ) );
$section->add_part( $cpt_coming_soon_content = new sm_textarea( 'cpt_coming_soon_content', array(
'label' => 'Custom Coming Soon Content',
'value' => 'Custom Coming Soon Content',
'description' => 'Coming Soon content to be used on Custom Coming Soon page.',
) ) );
// recommended you move this build line into an init action hook priority 20+
$this->site_options_page->build();
```

## Network Options Page

Simply set the `network_page` flag to true, and if you are on a multisite install, your options page will be in the mutlsite network admin navigation. **Note: plugin must be network activated to show network settings.** Here is an example:
```php
// create network-wide settings page
$this->network_options_page = new sm_options_page( array (
'parent_id' => 'settings.php',
'id' => 'network_settings',
'page_title' => 'Network Options',
'menu_title' => 'Network Options',
'network_page' => true
) );
```
148 changes: 0 additions & 148 deletions unminified-assets-v2/unminified.js

This file was deleted.

Loading

0 comments on commit bdcbecd

Please sign in to comment.