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
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
160
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
110
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
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
240
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
360
Multicaで30個のミニプロジェクトをAIエージェント運用して見えてきたこと
eiei114
1
550
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
1.1k
Network Firewallやっていき!
news_it_enj
0
220
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
690
「早く出す」より「事業に効く」 ── 顧客の業務サイクルから逆算するAI時代の二重ループ開発と「変化の設計者」 / devsumi2026
rakus_dev
1
510
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
260
AI x 開発生産性を取り巻く予算戦略と投資対効果
i35_267
4
1.9k
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
500
OPENLOGI Company Profile for engineer
hr01
1
74k
「休む」重要さ
smt7174
5
730
Featured
See All Featured
We Are The Robots
honzajavorek
0
280
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
350
Mind Mapping
helmedeiros
PRO
1
290
Utilizing Notion as your number one productivity tool
mfonobong
4
440
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
330
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
810
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
So, you think you're a good person
axbom
PRO
2
2.1k
The untapped power of vector embeddings
frankvandijk
2
1.8k
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