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
WordPress Hooks The Right Way to Extend Your Wo...
Search
WordCamp Bangkok
February 18, 2017
Technology
0
9
WordPress Hooks The Right Way to Extend Your WordPress
การเพิ่มขีดความสามารถให้ WordPress โดยใช้ WordPress Hooks
WordCamp Bangkok
February 18, 2017
Tweet
Share
More Decks by WordCamp Bangkok
See All by WordCamp Bangkok
Growing Together – Thoughts on the Global WordPress Community
wordcampbangkok
0
16
ทำ Instant Article กับ AMP บน WordPress ได้ไม่ง้อ Coding
wordcampbangkok
0
20
Learn how to create video with a smartphone for your WordPress blog
wordcampbangkok
0
11
Editor In Digital Content World
wordcampbangkok
0
10
How to become a web developer with WordPress and zero experience
wordcampbangkok
1
17
ออกแบบเว็บไซต์โดยใช้ User Journey
wordcampbangkok
0
15
WordPress Security – Know Your Enemy
wordcampbangkok
0
17
Creating-Thai-themes-2017
wordcampbangkok
0
12
ก้าวแรก WordPress ต้องรู้อะไรบ้าง
wordcampbangkok
0
14
Other Decks in Technology
See All in Technology
Storybook との上手な向き合い方を考える
re_taro
5
990
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
210
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
430
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
200
Application Development WG Intro at AppDeveloperCon
salaboy
0
200
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
200
複雑なState管理からの脱却
sansantech
PRO
1
160
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
2
230
日経電子版のStoreKit2フルリニューアル
shimastripe
1
150
Platform Engineering for Software Developers and Architects
syntasso
1
520
Featured
See All Featured
Bash Introduction
62gerente
608
210k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Music & Morning Musume
bryan
46
6.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Rails Girls Zürich Keynote
gr2m
94
13k
Become a Pro
speakerdeck
PRO
25
5k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Unsuck your backbone
ammeep
668
57k
Fireside Chat
paigeccino
34
3k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Transcript
WordPress Hooks: The Right Way to Extend Your WordPress
B Y K A N O U I V I R A C H http://www.freeiconspng.com/free-images/hook-icon-24086
Research & Development Architect KAN OUIVIRACH Who am I?
WHAT ARE HOOK?
http://vignette1.wikia.nocookie.net/villains/images/a/a6/Captain_Hook_(Hook).jpg/revision/ latest?cb=20140330214655 http://www.punchdrunksports.com/n4s-content/uploads/2015/01/Boxing-Right-Hook.jpg ??????
HOOK are… • Magic • Extend WordPress without messing with
the core! • Event-driven programming • Actions + Filters
How do they work?
What if we want to do something here? W O
R D P R E S S <code> </code> Normal Flow ? ? ?
Hook it! W O R D P R E S
S <code> </code> We write code. <code>
W O R D P R E S S <code>
</code> <code> New Flow!!! 2 1 3
Actions vs. Filters
File: wp-includes/plugin.php
File: wp-includes/plugin.php apply_filters
File: wp-includes/plugin.php do_action
Actions vs. Filters do something change something
File: functions.php Add text in ‘Footer’
File: functions.php Make content ‘UPPERCASE’
YOUR OWN HOOK!
Recap • Extend without modifying • Actions vs. Filters
Thank you https://github.com/zkan/wordcamp-bangkok-2017