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
13
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
17
ทำ Instant Article กับ AMP บน WordPress ได้ไม่ง้อ Coding
wordcampbangkok
0
22
Learn how to create video with a smartphone for your WordPress blog
wordcampbangkok
0
14
Editor In Digital Content World
wordcampbangkok
0
13
How to become a web developer with WordPress and zero experience
wordcampbangkok
1
19
ออกแบบเว็บไซต์โดยใช้ User Journey
wordcampbangkok
0
18
WordPress Security – Know Your Enemy
wordcampbangkok
0
21
Creating-Thai-themes-2017
wordcampbangkok
0
13
ก้าวแรก WordPress ต้องรู้อะไรบ้าง
wordcampbangkok
0
17
Other Decks in Technology
See All in Technology
Two-Tower モデルで実現する 検索リランキング / Shibuya_AI_2
visional_engineering_and_design
2
180
新規プロダクト開発、AIでどう変わった? #デザインエンジニアMeetup
bengo4com
0
420
AWS全冠したので振りかえってみる
tajimon
0
120
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
12k
開発効率と信頼性を両立する Ubieのプラットフォームエンジニアリング
teru0x1
0
130
Devin(Deep) Wiki/Searchの活用で変わる開発の世界観/devin-wiki-search-impact
tomoki10
0
260
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
770
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
280
マルチテナント+マルチプロダクト SaaS への AI Agent の組み込み方
kworkdev
PRO
2
280
CIでのgolangci-lintの実行を約90%削減した話
kazukihayase
0
110
New Cache Hierarchy for Container Images and OCI Artifacts in Kubernetes Clusters using Containerd / KubeCon + CloudNativeCon Japan
pfn
PRO
0
140
What's new in OpenShift 4.19
redhatlivestreaming
1
180
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
GitHub's CSS Performance
jonrohan
1031
460k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
770
Producing Creativity
orderedlist
PRO
346
40k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Making Projects Easy
brettharned
116
6.2k
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