php[world] Hooks, Actions and Filters Oh My!
-
Upload
david-laietta -
Category
Internet
-
view
299 -
download
0
Transcript of php[world] Hooks, Actions and Filters Oh My!
![Page 1: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/1.jpg)
@DAVIDLAIETTAHOOKS, ACTIONS, AND FILTERS OH MY!
![Page 2: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/2.jpg)
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
WHY USE HOOKS?
▸ Most WordPress features use actions and filters that you can modify to change how WordPress fundamentally works
▸ You can make complex changes easily without editing core, or existing plugins or themes that you’ve purchased
▸ Make changes at the source, instead of hacking away
▸ Upgrade without worry of losing your modifications
▸ Enable and disable your changes easily
obm.io/php2015-hooks
![Page 3: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/3.jpg)
Hooks: Places where you can add your own code.
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
obm.io/php2015-hooks
![Page 4: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/4.jpg)
Mr. WordPress
HOW A HOOK IS BORN
I’m going to do this thing.
Before you do your thing, I’ve got this other thing that I want to do.
Mr. WordPress
Ms. Plugin
Ok, do your thing, then I’ll do my thing!
obm.io/php2015-hooks
![Page 5: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/5.jpg)
Actions: Hooks that let you do something when something else happens
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
obm.io/php2015-hooks
![Page 7: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/7.jpg)
Filters: Hooks that let you modify data before or after interacting with the WordPress database
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
obm.io/php2015-hooks
![Page 9: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/9.jpg)
do_action()
Setting up our own hooks!
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
obm.io/php2015-hooks
![Page 12: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/12.jpg)
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
EXAMPLE: CHANGING EXCERPT LENGTH WITH A FILTER
obm.io/php2015-hooks
![Page 13: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/13.jpg)
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
EXAMPLE: GRAVITY FORMS FILTER
obm.io/php2015-hooks
![Page 14: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/14.jpg)
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
EXAMPLE: WOOCOMMERCE ACTION AND FILTER
obm.io/php2015-hooks
![Page 15: php[world] Hooks, Actions and Filters Oh My!](https://reader031.fdocuments.us/reader031/viewer/2022021815/5889684a1a28ab44758b4c3b/html5/thumbnails/15.jpg)
RESOURCES
▸ http://codex.wordpress.org/Plugin_API/Action_Reference
▸ http://codex.wordpress.org/Plugin_API/Filter_Reference
▸ http://blog.teamtreehouse.com/hooks-wordpress-actions-filters-examples
▸ https://docs.woothemes.com/document/hooks/
▸ https://www.gravityhelp.com/documentation/category/hooks/
▸ http://genesistutorials.com/visual-hook-guide/
HOOKS, ACTIONS, AND FILTERS OH MY! @DAVIDLAIETTA
obm.io/php2015-hooks