SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
r3df.com
lumostech.training
Rick Radko
“Creating Customizer Options
for Themes and Plugins”
WordCamp Toronto
October 4th, 2015
Slides at: slideshare.net/r3df
© 2015 Rick Radko, r3df.com
What's this talk about?
 An introduction to adding customizer options to
your plugins and themes.
Topics:
 Introduction
 Brief introduction to customizer
 Creating customizer options
 4 steps
 Using the options
 Beyond the Basics
1Slides at: slideshare.net/r3df
© 2015 Rick Radko, r3df.com
Objectives of this talk:
 Demonstrate that it is easy to add basic
customizer options to plugins and themes.
 Encourage you to start using the customizer for
your options.
For code examples for this presentation, I'm going
to use a plugin I created recently:
 wordpress.org/plugins/r3df-copyright-message
 (Version 1.1.0)
2Slides at: slideshare.net/r3df
© 2015 Rick Radko, r3df.com
About me
 Rick Radko, @r3designforge
Software, website and app designer/developer,
trainer, speaker.
 R-Cubed Design Forge: r3df.com
 LumosTech Training: lumostech.training
Creating custom web sites since 1996.
 WordPress sites since 2008.
An organizer of:
 WordCamp Ottawa.
 The Ottawa WordPress Group.
3Slides at: slideshare.net/r3df
© 2015 Rick Radko, r3df.com
Theme Customizer - WordPress 3.4
4
© 2015 Rick Radko, r3df.com
Customizer in 4.3
5
© 2015 Rick Radko, r3df.com
Customizer in 4.3 - Menus
6
© 2015 Rick Radko, r3df.com
Customizer in 4.3 - Site Icon
7
© 2015 Rick Radko, r3df.com
Why use the Customizer for options?
It provides a ready to use options framework:
 Native to WordPress
 No need to re-invent the wheel.
 Lots of built in controls.
 Can add custom controls.
 Now required for themes in wordpress.org repo.
 It’s the future for options.
I'm using it for:
 Custom theme & child theme options.
 Small plugins.
8
© 2015 Rick Radko, r3df.com
Plugin: Custom Login Page Customizer
9
© 2015 Rick Radko, r3df.com
Example Plugin: R3DF Copyright Message
10
wordpress.org/plugins/r3df-copyright-message
© 2015 Rick Radko, r3df.com
Adding a customizer option - 4 easy steps
1. Register your customizer set-up function.
2. Add a section.
3. Add settings.
4. Add controls to connect the settings to the
section.
11
© 2015 Rick Radko, r3df.com
Step 1. Register the customizer function
12
© 2015 Rick Radko, r3df.com
A gotcha for the 'customize_register' hook
From the codex:
"Important: Do not conditionally load your Customizer
code with an is_admin() check."
13
© 2015 Rick Radko, r3df.com
Step 2. Add a section
 $section_id - A unique ID for the section.
 $args: array
 title - the name of the section
 priority - (optional) controls display order of the
sections
 description - (optional) add descriptive text to the
section
14
© 2015 Rick Radko, r3df.com
Priorities for top level items
15
Priority (Order)
20
40
60
80
100
110
120
160 (default)
© 2015 Rick Radko, r3df.com
The section code for the plugin
Note:
 You will not be able to see the section until it
contains at least one control.
16
© 2015 Rick Radko, r3df.com
Step 3. Add setting(s)
 $setting_id - A unique ID for the setting.
 $args: array
 default - default value for the setting
 type - (optional)
types are 'option' or 'theme_mod'
type defaults to 'theme_mod'
Note:
 You will not be able to see the setting until it is
registered with a control.
17
© 2015 Rick Radko, r3df.com
Where are the values stored?
By default:
 Values are stored in the "wp_options" table.
 The option key depends on setting type:
 theme_mod:
Option key: theme_mods_{theme-name}
Array key (in the option): setting_id
 option:
Option key: setting_id
18
© 2015 Rick Radko, r3df.com
The settings code for the plugin
Note:
 The pseudo array notation, for the setting id, stores
the options as an array.
19
© 2015 Rick Radko, r3df.com
Step 4. Add control(s)
 $control_id - A unique ID for the control.
 If you set it to the value of a setting id, it will control
that setting. (instead of setting the settings arg)
 $args: array
 label - a label for the control
 description - a description below the label
 section - the section for the control
 type - basic types include:
text, checkbox, radio, select, dropdown-pages,
textarea…
20
© 2015 Rick Radko, r3df.com
The controls code for the plugin
21
© 2015 Rick Radko, r3df.com
The controls code for the plugin
22
© 2015 Rick Radko, r3df.com
The plugin display so far in customizer
23
© 2015 Rick Radko, r3df.com
The plugin - expanded
24
© 2015 Rick Radko, r3df.com
Where’s the copyright message?
25
© 2015 Rick Radko, r3df.com
Using saved option values
Setting type:
 theme_mod:
 option:
 Can use with standard WordPress options.
ie: convert existing plugin
26
© 2015 Rick Radko, r3df.com
The plugin's output code
27
© 2015 Rick Radko, r3df.com
The complete result in the customizer
28
© 2015 Rick Radko, r3df.com
The result on the frontend
29
© 2015 Rick Radko, r3df.com
Beyond the basics - Conditional actions
Conditional display – dependent on radio button 30
© 2015 Rick Radko, r3df.com
Beyond the basics - Transport
By default, when a customizer setting is changed:
 The preview is updated with a page refresh.
 This has a notable lag…
But, we can fix that…
31
© 2015 Rick Radko, r3df.com
Beyond the basics - Transport
Add some javascript…
…and the page will update “instantly”.
Note:
 Preview javascript is loaded on the
"customize_preview_init" action 32
© 2015 Rick Radko, r3df.com
Beyond the basics - Sanitizing values
Input data can be sanitized by adding callbacks to
the add_setting() definition:
 Built in WordPress functions can often be used.
 sanitize_key() checks that the data looks like an
internal identifier (key).
33
© 2015 Rick Radko, r3df.com
Beyond the basics - Panels
34
2 Items
© 2015 Rick Radko, r3df.com
Beyond the basics - Panels
35
New top level
© 2015 Rick Radko, r3df.com
Beyond the basics - Panels
36
© 2015 Rick Radko, r3df.com
Beyond the basics - Panels
 Panel with 2 sections
37
© 2015 Rick Radko, r3df.com
Beyond the basics - Modifying existing sections
 get_panel() for panels, get_setting() for settings, and
get_control() for controls
38
Section Id
title_tagline
colors
header_image
background_image
nav_menus
widgets
static_front_page
r3df_copyright_message_settings
© 2015 Rick Radko, r3df.com
Beyond the basics - Advanced controls
Advanced Controls:
 Color picker: WP_Customize_Color_Control()
 Media uploader: WP_Customize_Upload_Control()
 Image uploader: WP_Customize_Image_Control()
 Background image control:
WP_Customize_Background_Image_Control()
 Header image control:
WP_Customize_Header_Image_Control()
Custom controls:
 ottopress.com/2012/making-a-custom-control-for-
the-theme-customizer/
39
© 2015 Rick Radko, r3df.com
How does preview update without saving?
The customizer preview intercepts calls to:
 get_theme_mod
 get_option
Replaces them with the "live" content from the
customizer controls.
Note:
 This only seems to work on or after the action
"parse_request".
40
© 2015 Rick Radko, r3df.com
Learn More…
 codex.wordpress.org/Theme_Customization_API
 developer.wordpress.org/themes/advanced-topics/customizer-api/
 developer.wordpress.org/reference/classes/wp_customize_manager/
 ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-
themes/
 ottopress.com/2012/theme-customizer-part-deux-getting-rid-of-options-
pages/
 ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/
 ottopress.com/2015/whats-new-with-the-customizer/
 gavick.com/blog/contextual-controls-theme-customizer
 gavick.com/blog/using-javascript-theme-customization-screen
 make.wordpress.org/core/2014/10/27/toward-a-complete-javascript-api-
for-the-customizer/
 make.wordpress.org/core/2015/07/27/site-icon/
41
© 2015 Rick Radko, r3df.com
Contact
Rick Radko
 email: wpinfo@r3df.com
 twitter: @r3designforge
Websites:
 r3df.com
 lumostech.training
Slides at:
 www.slideshare.net/r3df
42

Weitere ähnliche Inhalte

Was ist angesagt?

How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5ketanraval
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5Ketan Raval
 
The Future of the Web: HTML5
The Future of the Web: HTML5The Future of the Web: HTML5
The Future of the Web: HTML5Derek Bender
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
soft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch
 
Wordpress Command-Line
Wordpress Command-LineWordpress Command-Line
Wordpress Command-Linewpperu
 
Mage Titans USA 2016 M2 deployment
Mage Titans USA 2016  M2 deploymentMage Titans USA 2016  M2 deployment
Mage Titans USA 2016 M2 deploymentOlga Kopylova
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8Acquia
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPressMicah Wood
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesAcquia
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Grav CMS
Grav CMSGrav CMS
Grav CMSbtopro
 
What the heck is HTML 5?
What the heck is HTML 5?What the heck is HTML 5?
What the heck is HTML 5?Simon Willison
 
HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)Peter Lubbers
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16tshellberg
 

Was ist angesagt? (18)

How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
Introduction to-concrete-5
Introduction to-concrete-5Introduction to-concrete-5
Introduction to-concrete-5
 
The Future of the Web: HTML5
The Future of the Web: HTML5The Future of the Web: HTML5
The Future of the Web: HTML5
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
soft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easy
 
Wordpress Command-Line
Wordpress Command-LineWordpress Command-Line
Wordpress Command-Line
 
Mage Titans USA 2016 M2 deployment
Mage Titans USA 2016  M2 deploymentMage Titans USA 2016  M2 deployment
Mage Titans USA 2016 M2 deployment
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPress
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
html5.ppt
html5.ppthtml5.ppt
html5.ppt
 
Grav CMS
Grav CMSGrav CMS
Grav CMS
 
What the heck is HTML 5?
What the heck is HTML 5?What the heck is HTML 5?
What the heck is HTML 5?
 
HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)HTML5--The 30,000' View (A fast-paced overview of HTML5)
HTML5--The 30,000' View (A fast-paced overview of HTML5)
 
Theming 101
Theming 101Theming 101
Theming 101
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16
 

Andere mochten auch

Using Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnUsing Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnBrian Hogg
 
Systematic Unit Testing
Systematic Unit TestingSystematic Unit Testing
Systematic Unit Testingscotchfield
 
A Noob's Journey to the Core
A Noob's Journey to the CoreA Noob's Journey to the Core
A Noob's Journey to the CoreRyan Welcher
 
How I Made a Career Using WordPress Without Knowing a Line of Code
How I Made a Career Using WordPress Without Knowing a Line of CodeHow I Made a Career Using WordPress Without Knowing a Line of Code
How I Made a Career Using WordPress Without Knowing a Line of CodeAndrea Zoellner
 
Help Me Help You: Practical Tips for Designers from A WordPress Developer
Help Me Help You: Practical Tips for Designers from A WordPress DeveloperHelp Me Help You: Practical Tips for Designers from A WordPress Developer
Help Me Help You: Practical Tips for Designers from A WordPress Developerdaraskolnick
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressRami Sayar
 
WordCamp Toronto 2015- API Simple Talk
WordCamp Toronto 2015- API Simple TalkWordCamp Toronto 2015- API Simple Talk
WordCamp Toronto 2015- API Simple Talkting-y
 
Building and Maintaining A Remote Workforce - A Startup Story
Building and Maintaining A Remote Workforce - A Startup StoryBuilding and Maintaining A Remote Workforce - A Startup Story
Building and Maintaining A Remote Workforce - A Startup StorySucuri
 
Community Consultation Creates Compelling Content
Community Consultation Creates Compelling Content  Community Consultation Creates Compelling Content
Community Consultation Creates Compelling Content Christine Pollock
 
You have 2 hands Toronto
You have 2 hands TorontoYou have 2 hands Toronto
You have 2 hands TorontoShayda Torabi
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPressShawn Hooper
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteTaylor McCaslin
 
Delightful Design with the Kano Model (WordCamp Toronto 2015)
Delightful Design with the Kano Model (WordCamp Toronto 2015)Delightful Design with the Kano Model (WordCamp Toronto 2015)
Delightful Design with the Kano Model (WordCamp Toronto 2015)Jesse Emmanuel Rosario
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPressSuzette Franck
 
Multilingual content with WordPress
Multilingual content with WordPressMultilingual content with WordPress
Multilingual content with WordPressDesaulniers-Simard
 

Andere mochten auch (20)

Ecomm 101
Ecomm 101Ecomm 101
Ecomm 101
 
Wordcamp_mcglade_ux_mashups
Wordcamp_mcglade_ux_mashupsWordcamp_mcglade_ux_mashups
Wordcamp_mcglade_ux_mashups
 
Using Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your OwnUsing Actions and Filters in WordPress to Make a Plugin Your Own
Using Actions and Filters in WordPress to Make a Plugin Your Own
 
Systematic Unit Testing
Systematic Unit TestingSystematic Unit Testing
Systematic Unit Testing
 
A Noob's Journey to the Core
A Noob's Journey to the CoreA Noob's Journey to the Core
A Noob's Journey to the Core
 
How I Made a Career Using WordPress Without Knowing a Line of Code
How I Made a Career Using WordPress Without Knowing a Line of CodeHow I Made a Career Using WordPress Without Knowing a Line of Code
How I Made a Career Using WordPress Without Knowing a Line of Code
 
Help Me Help You: Practical Tips for Designers from A WordPress Developer
Help Me Help You: Practical Tips for Designers from A WordPress DeveloperHelp Me Help You: Practical Tips for Designers from A WordPress Developer
Help Me Help You: Practical Tips for Designers from A WordPress Developer
 
Mystery solved pages vs posts
Mystery solved pages vs postsMystery solved pages vs posts
Mystery solved pages vs posts
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
 
WordCamp Toronto 2015- API Simple Talk
WordCamp Toronto 2015- API Simple TalkWordCamp Toronto 2015- API Simple Talk
WordCamp Toronto 2015- API Simple Talk
 
Building and Maintaining A Remote Workforce - A Startup Story
Building and Maintaining A Remote Workforce - A Startup StoryBuilding and Maintaining A Remote Workforce - A Startup Story
Building and Maintaining A Remote Workforce - A Startup Story
 
Community Consultation Creates Compelling Content
Community Consultation Creates Compelling Content  Community Consultation Creates Compelling Content
Community Consultation Creates Compelling Content
 
You have 2 hands Toronto
You have 2 hands TorontoYou have 2 hands Toronto
You have 2 hands Toronto
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPress
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
Managed WordPress Demystified
Managed WordPress DemystifiedManaged WordPress Demystified
Managed WordPress Demystified
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress Multisite
 
Delightful Design with the Kano Model (WordCamp Toronto 2015)
Delightful Design with the Kano Model (WordCamp Toronto 2015)Delightful Design with the Kano Model (WordCamp Toronto 2015)
Delightful Design with the Kano Model (WordCamp Toronto 2015)
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
 
Multilingual content with WordPress
Multilingual content with WordPressMultilingual content with WordPress
Multilingual content with WordPress
 

Ähnlich wie Creating Customizer Options for Themes and Plugins

WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and moreR-Cubed Design Forge
 
A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentR-Cubed Design Forge
 
Intro to development sites and site migration
Intro to development sites and site migrationIntro to development sites and site migration
Intro to development sites and site migrationR-Cubed Design Forge
 
Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019rickrrr
 
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)cgmonroe
 
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios
 
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...R-Cubed Design Forge
 
Introduction to WordPress for Beginners
Introduction to WordPress for BeginnersIntroduction to WordPress for Beginners
Introduction to WordPress for BeginnersR-Cubed Design Forge
 
CISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentCISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentBrad Rippe
 
Hand-On Lab: CA Release Automation Rapid Development Kit and SDK
Hand-On Lab: CA Release Automation Rapid Development Kit and SDKHand-On Lab: CA Release Automation Rapid Development Kit and SDK
Hand-On Lab: CA Release Automation Rapid Development Kit and SDKCA Technologies
 
Gutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteGutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteR-Cubed Design Forge
 
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...CA Technologies
 
Turbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appTurbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appfRui Apps
 
Developer insight into why applications run amazingly Fast in CF 2018
Developer insight into why applications run amazingly Fast in CF 2018Developer insight into why applications run amazingly Fast in CF 2018
Developer insight into why applications run amazingly Fast in CF 2018Pavan Kumar
 
Working with Images in WordPress
Working with Images in WordPress Working with Images in WordPress
Working with Images in WordPress randyhoyt
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateAmazon Web Services
 

Ähnlich wie Creating Customizer Options for Themes and Plugins (20)

WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and more
 
A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin development
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
Intro to development sites and site migration
Intro to development sites and site migrationIntro to development sites and site migration
Intro to development sites and site migration
 
Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019
 
Multisite for multilingual
Multisite for multilingualMultisite for multilingual
Multisite for multilingual
 
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
 
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
 
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
 
Introduction to WordPress for Beginners
Introduction to WordPress for BeginnersIntroduction to WordPress for Beginners
Introduction to WordPress for Beginners
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
CISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentCISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 Development
 
Hand-On Lab: CA Release Automation Rapid Development Kit and SDK
Hand-On Lab: CA Release Automation Rapid Development Kit and SDKHand-On Lab: CA Release Automation Rapid Development Kit and SDK
Hand-On Lab: CA Release Automation Rapid Development Kit and SDK
 
Gutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteGutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress site
 
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...
Pre-Con Education: Zero to Compliance Using Software Asset Management Soluti...
 
Turbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc appTurbogears2 tutorial to create mvc app
Turbogears2 tutorial to create mvc app
 
Developer insight into why applications run amazingly Fast in CF 2018
Developer insight into why applications run amazingly Fast in CF 2018Developer insight into why applications run amazingly Fast in CF 2018
Developer insight into why applications run amazingly Fast in CF 2018
 
Working with Images in WordPress
Working with Images in WordPress Working with Images in WordPress
Working with Images in WordPress
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
Backups, Backups, Backups
Backups, Backups, BackupsBackups, Backups, Backups
Backups, Backups, Backups
 

Mehr von R-Cubed Design Forge

Finding themes for your WordPress site
Finding themes for your WordPress siteFinding themes for your WordPress site
Finding themes for your WordPress siteR-Cubed Design Forge
 
Setting up a local web server environment
Setting up a local web server environmentSetting up a local web server environment
Setting up a local web server environmentR-Cubed Design Forge
 
Gutenberg - The future of WordPress
Gutenberg - The future of WordPressGutenberg - The future of WordPress
Gutenberg - The future of WordPressR-Cubed Design Forge
 
Setting up a local web server for WordPress
Setting up a local web server for WordPressSetting up a local web server for WordPress
Setting up a local web server for WordPressR-Cubed Design Forge
 
Backing up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalBacking up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalR-Cubed Design Forge
 
Getting WordPress to speak your langauge
Getting WordPress to speak your langaugeGetting WordPress to speak your langauge
Getting WordPress to speak your langaugeR-Cubed Design Forge
 
How to WordPress: the basics, part 1
How to WordPress:  the basics, part 1How to WordPress:  the basics, part 1
How to WordPress: the basics, part 1R-Cubed Design Forge
 

Mehr von R-Cubed Design Forge (8)

Finding themes for your WordPress site
Finding themes for your WordPress siteFinding themes for your WordPress site
Finding themes for your WordPress site
 
Setting up a local web server environment
Setting up a local web server environmentSetting up a local web server environment
Setting up a local web server environment
 
Gutenberg - The future of WordPress
Gutenberg - The future of WordPressGutenberg - The future of WordPress
Gutenberg - The future of WordPress
 
Backups, Backups, Backups
Backups, Backups, BackupsBackups, Backups, Backups
Backups, Backups, Backups
 
Setting up a local web server for WordPress
Setting up a local web server for WordPressSetting up a local web server for WordPress
Setting up a local web server for WordPress
 
Backing up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalBacking up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optional
 
Getting WordPress to speak your langauge
Getting WordPress to speak your langaugeGetting WordPress to speak your langauge
Getting WordPress to speak your langauge
 
How to WordPress: the basics, part 1
How to WordPress:  the basics, part 1How to WordPress:  the basics, part 1
How to WordPress: the basics, part 1
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Creating Customizer Options for Themes and Plugins

  • 1. r3df.com lumostech.training Rick Radko “Creating Customizer Options for Themes and Plugins” WordCamp Toronto October 4th, 2015 Slides at: slideshare.net/r3df
  • 2. © 2015 Rick Radko, r3df.com What's this talk about?  An introduction to adding customizer options to your plugins and themes. Topics:  Introduction  Brief introduction to customizer  Creating customizer options  4 steps  Using the options  Beyond the Basics 1Slides at: slideshare.net/r3df
  • 3. © 2015 Rick Radko, r3df.com Objectives of this talk:  Demonstrate that it is easy to add basic customizer options to plugins and themes.  Encourage you to start using the customizer for your options. For code examples for this presentation, I'm going to use a plugin I created recently:  wordpress.org/plugins/r3df-copyright-message  (Version 1.1.0) 2Slides at: slideshare.net/r3df
  • 4. © 2015 Rick Radko, r3df.com About me  Rick Radko, @r3designforge Software, website and app designer/developer, trainer, speaker.  R-Cubed Design Forge: r3df.com  LumosTech Training: lumostech.training Creating custom web sites since 1996.  WordPress sites since 2008. An organizer of:  WordCamp Ottawa.  The Ottawa WordPress Group. 3Slides at: slideshare.net/r3df
  • 5. © 2015 Rick Radko, r3df.com Theme Customizer - WordPress 3.4 4
  • 6. © 2015 Rick Radko, r3df.com Customizer in 4.3 5
  • 7. © 2015 Rick Radko, r3df.com Customizer in 4.3 - Menus 6
  • 8. © 2015 Rick Radko, r3df.com Customizer in 4.3 - Site Icon 7
  • 9. © 2015 Rick Radko, r3df.com Why use the Customizer for options? It provides a ready to use options framework:  Native to WordPress  No need to re-invent the wheel.  Lots of built in controls.  Can add custom controls.  Now required for themes in wordpress.org repo.  It’s the future for options. I'm using it for:  Custom theme & child theme options.  Small plugins. 8
  • 10. © 2015 Rick Radko, r3df.com Plugin: Custom Login Page Customizer 9
  • 11. © 2015 Rick Radko, r3df.com Example Plugin: R3DF Copyright Message 10 wordpress.org/plugins/r3df-copyright-message
  • 12. © 2015 Rick Radko, r3df.com Adding a customizer option - 4 easy steps 1. Register your customizer set-up function. 2. Add a section. 3. Add settings. 4. Add controls to connect the settings to the section. 11
  • 13. © 2015 Rick Radko, r3df.com Step 1. Register the customizer function 12
  • 14. © 2015 Rick Radko, r3df.com A gotcha for the 'customize_register' hook From the codex: "Important: Do not conditionally load your Customizer code with an is_admin() check." 13
  • 15. © 2015 Rick Radko, r3df.com Step 2. Add a section  $section_id - A unique ID for the section.  $args: array  title - the name of the section  priority - (optional) controls display order of the sections  description - (optional) add descriptive text to the section 14
  • 16. © 2015 Rick Radko, r3df.com Priorities for top level items 15 Priority (Order) 20 40 60 80 100 110 120 160 (default)
  • 17. © 2015 Rick Radko, r3df.com The section code for the plugin Note:  You will not be able to see the section until it contains at least one control. 16
  • 18. © 2015 Rick Radko, r3df.com Step 3. Add setting(s)  $setting_id - A unique ID for the setting.  $args: array  default - default value for the setting  type - (optional) types are 'option' or 'theme_mod' type defaults to 'theme_mod' Note:  You will not be able to see the setting until it is registered with a control. 17
  • 19. © 2015 Rick Radko, r3df.com Where are the values stored? By default:  Values are stored in the "wp_options" table.  The option key depends on setting type:  theme_mod: Option key: theme_mods_{theme-name} Array key (in the option): setting_id  option: Option key: setting_id 18
  • 20. © 2015 Rick Radko, r3df.com The settings code for the plugin Note:  The pseudo array notation, for the setting id, stores the options as an array. 19
  • 21. © 2015 Rick Radko, r3df.com Step 4. Add control(s)  $control_id - A unique ID for the control.  If you set it to the value of a setting id, it will control that setting. (instead of setting the settings arg)  $args: array  label - a label for the control  description - a description below the label  section - the section for the control  type - basic types include: text, checkbox, radio, select, dropdown-pages, textarea… 20
  • 22. © 2015 Rick Radko, r3df.com The controls code for the plugin 21
  • 23. © 2015 Rick Radko, r3df.com The controls code for the plugin 22
  • 24. © 2015 Rick Radko, r3df.com The plugin display so far in customizer 23
  • 25. © 2015 Rick Radko, r3df.com The plugin - expanded 24
  • 26. © 2015 Rick Radko, r3df.com Where’s the copyright message? 25
  • 27. © 2015 Rick Radko, r3df.com Using saved option values Setting type:  theme_mod:  option:  Can use with standard WordPress options. ie: convert existing plugin 26
  • 28. © 2015 Rick Radko, r3df.com The plugin's output code 27
  • 29. © 2015 Rick Radko, r3df.com The complete result in the customizer 28
  • 30. © 2015 Rick Radko, r3df.com The result on the frontend 29
  • 31. © 2015 Rick Radko, r3df.com Beyond the basics - Conditional actions Conditional display – dependent on radio button 30
  • 32. © 2015 Rick Radko, r3df.com Beyond the basics - Transport By default, when a customizer setting is changed:  The preview is updated with a page refresh.  This has a notable lag… But, we can fix that… 31
  • 33. © 2015 Rick Radko, r3df.com Beyond the basics - Transport Add some javascript… …and the page will update “instantly”. Note:  Preview javascript is loaded on the "customize_preview_init" action 32
  • 34. © 2015 Rick Radko, r3df.com Beyond the basics - Sanitizing values Input data can be sanitized by adding callbacks to the add_setting() definition:  Built in WordPress functions can often be used.  sanitize_key() checks that the data looks like an internal identifier (key). 33
  • 35. © 2015 Rick Radko, r3df.com Beyond the basics - Panels 34 2 Items
  • 36. © 2015 Rick Radko, r3df.com Beyond the basics - Panels 35 New top level
  • 37. © 2015 Rick Radko, r3df.com Beyond the basics - Panels 36
  • 38. © 2015 Rick Radko, r3df.com Beyond the basics - Panels  Panel with 2 sections 37
  • 39. © 2015 Rick Radko, r3df.com Beyond the basics - Modifying existing sections  get_panel() for panels, get_setting() for settings, and get_control() for controls 38 Section Id title_tagline colors header_image background_image nav_menus widgets static_front_page r3df_copyright_message_settings
  • 40. © 2015 Rick Radko, r3df.com Beyond the basics - Advanced controls Advanced Controls:  Color picker: WP_Customize_Color_Control()  Media uploader: WP_Customize_Upload_Control()  Image uploader: WP_Customize_Image_Control()  Background image control: WP_Customize_Background_Image_Control()  Header image control: WP_Customize_Header_Image_Control() Custom controls:  ottopress.com/2012/making-a-custom-control-for- the-theme-customizer/ 39
  • 41. © 2015 Rick Radko, r3df.com How does preview update without saving? The customizer preview intercepts calls to:  get_theme_mod  get_option Replaces them with the "live" content from the customizer controls. Note:  This only seems to work on or after the action "parse_request". 40
  • 42. © 2015 Rick Radko, r3df.com Learn More…  codex.wordpress.org/Theme_Customization_API  developer.wordpress.org/themes/advanced-topics/customizer-api/  developer.wordpress.org/reference/classes/wp_customize_manager/  ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own- themes/  ottopress.com/2012/theme-customizer-part-deux-getting-rid-of-options- pages/  ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/  ottopress.com/2015/whats-new-with-the-customizer/  gavick.com/blog/contextual-controls-theme-customizer  gavick.com/blog/using-javascript-theme-customization-screen  make.wordpress.org/core/2014/10/27/toward-a-complete-javascript-api- for-the-customizer/  make.wordpress.org/core/2015/07/27/site-icon/ 41
  • 43. © 2015 Rick Radko, r3df.com Contact Rick Radko  email: wpinfo@r3df.com  twitter: @r3designforge Websites:  r3df.com  lumostech.training Slides at:  www.slideshare.net/r3df 42