wc no

23
The Power of Option Frameworks

Upload: ivdimova

Post on 04-Jul-2015

1.965 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wc no

The Power of Option Frameworks

Page 2: Wc no

Me, myself and WordPress

Page 3: Wc no

WordPress Themes

Page 4: Wc no

And even better ones

Page 5: Wc no
Page 6: Wc no
Page 7: Wc no

Option frameworks

Page 8: Wc no

Creating theme options never been easier

Sanitization and Validation

Easier to reuse

Fancy option fields

Option frameworks

Page 9: Wc no

Options Framework Plugin

demo-theme/options.php => theme root folder

$multicheck_array = array(

'one' => __('French Toast', 'options_check'),

'two' => __('Pancake', 'options_check'),

'three' => __('Omelette', 'options_check'),

'four' => __('Crepe', 'options_check'),

'five' => __('Waffle', 'options_check')

);

Page 10: Wc no

of_get_option('example_text_mini', 'no entry');

Page 11: Wc no

NHP Theme Options Framework

Page 12: Wc no

functions.php -> get_template_part('nhp', 'options');

nhp-options.php:

array('id' => '4','type' => 'text','title' => __('Text Option - Numeric Validated', 'nhp-opts'),

'sub_desc' => __('Numeric.', 'nhp-opts'),'desc' => __('Description.', 'nhp-opts'),'validate' => 'numeric','std' => '0','class' => 'small-text'

),

Page 13: Wc no

global $NHP_Options;$NHP_Options = new NHP_Options($sections, $args);->get & show methods

Page 14: Wc no

ProPanel

Page 15: Wc no

$sample_text_field = get_option('yourtheme_sample_text_field');echo $sample_text_field;

Page 16: Wc no

CheezCap require_once('cheezcap/cheezcap.php');

cheezcap/config.php:

new BooleanOption(

'Simple Boolean Example',

'This will create a simple true/false switch with default of "true".',

'simple_boolean_example',

true

),

Page 17: Wc no

if ($cap->my_boolean_option) {// do stuff}

Page 18: Wc no

Up Themes Framework

if( file_exists(get_template_directory().

'/options/options.php') )

include_once(get_template_directory().

'/options/options.php');

register_theme_options();

register_theme_options_tab();

Page 19: Wc no

Up Themes Framework

$options = array("font_color" => array( "tab" => "colors_and_images", "name" => "font_color", "title" => "Font Color", "description" => __( "Select a font color for your theme", "example" ), "section" => "color_scheme", "since" => "1.0", "id" => "color_scheme", "type" => "text", "default" => "Copyright 2012 UpThemes" ));

Page 20: Wc no
Page 21: Wc no

Comparison

Updates and support

Variety of needed options

Reusing

Page 22: Wc no

Contacts @iv_wp http://it.ivdimova.com http://www.linkedin.com/in/ivdimova

Page 23: Wc no