Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using the WordPress Customizer to Build Beautif...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Patrick Rauland
May 08, 2015
Technology
2
1.1k
Using the WordPress Customizer to Build Beautiful Plugin Settings Pages
Using the Customizer at LoopConf
Patrick Rauland
May 08, 2015
Tweet
Share
More Decks by Patrick Rauland
See All by Patrick Rauland
Google Analytics for Clients
bftrick
0
150
Black Friday 2020: Your Biggest Sales Day Yet
bftrick
1
110
10 Uncommon (& Weird) Ways to Prevent Fights
bftrick
0
230
WooCommerce and You - A Love Story - WordCamp Minneapolis 2018
bftrick
0
100
Live Your Life Like a Supervillain
bftrick
0
190
Ninja Gravity Form 7
bftrick
0
97
Are Robots Coming for Your Job?
bftrick
0
97
Scoping eCommerce Projects
bftrick
0
300
Accounting basics you need to get to a $1M+ seller
bftrick
0
150
Other Decks in Technology
See All in Technology
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4k
大規模な組織におけるAI Agent活用の促進と課題
lycorptech_jp
PRO
5
7k
Claude Codeはレガシー移行でどこまで使えるのか?
ak2ie
1
1.1k
Databricks (と気合い)で頑張るAI Agent 運用
kameitomohiro
0
340
AWS CDK の目玉新機能「Mixins」とは / cdk-mixins
gotok365
2
290
Introduction to Bill One Development Engineer
sansan33
PRO
0
380
Snowflake Night #2 LT
taromatsui_cccmkhd
0
270
トラブルの大半は「言ってない」x「言ってない」じゃねーか!!
ichimichi
0
220
Exadata Fleet Update
oracle4engineer
PRO
0
1.3k
LLM活用の壁を超える:リクルートR&Dの戦略と打ち手
recruitengineers
PRO
1
170
ソフトウェアアーキテクトのための意思決定術: Create Decision Readiness—The Real Skill Behind Architectural Decision
snoozer05
PRO
27
7.7k
パネルディスカッション資料 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
770
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Spectacular Lies of Maps
axbom
PRO
1
570
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
230
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Thoughts on Productivity
jonyablonski
75
5.1k
Balancing Empowerment & Direction
lara
5
920
Exploring anti-patterns in Rails
aemeredith
2
280
Six Lessons from altMBA
skipperchong
29
4.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
Using the WordPress Customizer to Build Beautiful Plugin Settings Pages
Patrick Rauland @BFTrick
None
Reading Can Be Difficult
No matter how clearly you write people will misinterpret your
words.
None
None
None
None
None
None
7 Steps to Hijack the Customizer
1. Create a Button That Loads the Customizer
// get customizer url $url = admin_url( 'customize.php' );
array( 'title' => __( 'Customize!', 'woocommerce' ), 'desc' => __(
'Customize your product archive pages with the WordPress Customizer.', 'woocommerce' ), 'type' => 'wc_button', 'link' => $url ) WooCommerce Settings API: http://docs.woothemes.com/ document/settings-api/
None
2. Load a Specific Page
// get special page $shop_page_url = get_permalink( wc_get_page_id( 'shop' )
); // if we have a shop page go straight to it // the default will load the home page if ( $shop_page_url ) { $url = add_query_arg( 'url', urlencode( $shop_page_url ), $url ); }
None
3. Add a Return URL
// get the return page $url = add_query_arg( 'return', urlencode(
add_query_arg( array( 'page' => 'wc-settings', 'tab' => 'email' ), admin_url( 'admin.php' ) ) ), $url );
None
4. Add a Flag in Customizer URL
$url = add_query_arg( 'wc-email-customizer', 'true', $url );
5. Hide Default Controls
add_filter( 'customize_control_active', 'control_filter', 10, 2 ); function control_filter( $active, $control
) { if ( in_array( $control->section, array( 'wc_email_header', 'wc_email_body', 'wc_email_footer', 'wc_email_send' ) ) ) { return true; } return false; }
global $wp_customize; $wp_customize->remove_section( 'themes' );
None
6. Add New controls
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'wc_email_header_image_control', array( 'label' => __( 'Upload
a Header', 'woocommerce' ), 'priority' => 10, 'section' => 'wc_email_header', 'settings' => 'woocommerce_email_header_image', ) ) );
// autofocus a section $url = add_query_arg( 'autofocus[section]', '{name of
your section}', $url );
None
7. Save Settings as Plugin Options
$wp_customize->add_setting( 'wc_email_background_color', array( 'type' => 'option', 'default' => '#f5f5f5', 'transport'
=> 'postMessage', ) );
None
No matter how clearly you write people will misinterpret your
words
Using the Customizer allows you to show users what a
setting does
Patrick Rauland @BFTrick WooCommerce Product Manager WooThemes