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
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
98
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
「通るまでRe-run」から卒業!落ちないテストを書く勘所
asumikam
2
340
NewSQL_ ストレージ分離と分散合意を用いたスケーラブルアーキテクチャ
hacomono
PRO
4
410
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
13k
フロントエンド刷新 4年間の軌跡
yotahada3
0
510
システム標準化PMOから ガバメントクラウドCoEへ
techniczna
1
150
Claude Code 2026年 最新アップデート
oikon48
14
11k
詳解 強化学習 / In-depth Guide to Reinforcement Learning
prinlab
0
310
20260311 ビジネスSWG活動報告(デジタルアイデンティティ人材育成推進WG Ph2 活動報告会)
oidfj
0
350
AWS CDK「読めるけど書けない」を脱却するファーストステップ
smt7174
3
200
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
20260311 技術SWG活動報告(デジタルアイデンティティ人材育成推進WG Ph2 活動報告会)
oidfj
0
370
TypeScript 7.0の現在地と備え方
uhyo
7
1.9k
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
90
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
ラッコキーワード サービス紹介資料
rakko
1
2.7M
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
640
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
320
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
210
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