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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Patrick Rauland
May 08, 2015
Technology
1.1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using the WordPress Customizer to Build Beautiful Plugin Settings Pages
Using the Customizer at LoopConf
Patrick Rauland
May 08, 2015
More Decks by Patrick Rauland
See All by Patrick Rauland
Google Analytics for Clients
bftrick
0
170
Black Friday 2020: Your Biggest Sales Day Yet
bftrick
1
120
10 Uncommon (& Weird) Ways to Prevent Fights
bftrick
0
250
WooCommerce and You - A Love Story - WordCamp Minneapolis 2018
bftrick
0
110
Live Your Life Like a Supervillain
bftrick
0
200
Ninja Gravity Form 7
bftrick
0
110
Are Robots Coming for Your Job?
bftrick
0
120
Scoping eCommerce Projects
bftrick
0
320
Accounting basics you need to get to a $1M+ seller
bftrick
0
160
Other Decks in Technology
See All in Technology
ラジオの科学
frievea
0
300
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
200
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
130
Genie Codeハンズオン基礎編
taka_aki
1
100
【CEDEC2026】『Relink』を拡張せよ - 『GRANBLUE FANTASY: Relink - Endless Ragnarok』の開発速度と品質を守るCI運用
cygames
PRO
0
150
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
180
20分でわかるセキュアAPI
nwiizo
2
250
MIRU 2026 チュートリアル
keisuke198619
0
880
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
3
720
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
1
240
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
450
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
490
GraphQLとの向き合い方2022年版
quramy
50
15k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Code Reviewing Like a Champion
maltzj
528
40k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
460
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
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