SlideShare a Scribd company logo
build create W O R D C A M P C H I C A G O
W O R D P R E S S F I LT E R S &
A C T I O N S
U N D E R S TA N D I N G
build create W O R D C A M P C H I C A G O
build create W O R D C A M P C H I C A G O
H I .
Designer, developer,
marketer, shit-talker, etc.
Owner build/create studios
@buildcreate @wilsonography

buildcreate.com
I ’ M I A N , N I C E T O M E E T Y O U .
build create W O R D C A M P C H I C A G O
M Y S E L F I S H G O A L S F O R Y O U
I want you to walk away from this feeling a little less
hacky, a little more informed, and most of all inspired.
I want you to have an “Ah ha!” moment, where suddenly
your understanding of WordPress becomes that much
clearer, and you can’t wait to get out of this room to try
out your new knowledge.
Here goes nothing…
build create W O R D C A M P C H I C A G O
A W O R L D W I T H O U T H O O K S
build create W O R D C A M P C H I C A G O
I T ’ S P R E T T Y D A M N H A C K Y
• Including extra PHP files for ajax
requests
• Hacking into plugins to change
display/functionality
• Hacking *gasp* WP core files
• Hacking theme files (when you
should be using a child theme)
• Hackity hack hack hack.
build create W O R D C A M P C H I C A G O
L E T ’ S TA L K A B O U T H O O K S
“Hooks enable us to literally hook into parts of the
WordPress page lifecycle to retrieve, insert, or modify
data, or they allow us to take certain actions behind the
scenes.”

- T O M M C FA R L I N @ T U T S P L U S
build create W O R D C A M P C H I C A G O
Where does all of this
fit into the WP
loading process?
build create W O R D C A M P C H I C A G O
S O T H E Y ’ R E B O T H H O O K S , T H E Y C A N K E E P
M E F R O M H A C K I N G M Y W O R D P R E S S
I N S TA L L T O S H R E D S W I T H M Y I N E P T I T U D E ,
I G E T T H AT, W H AT ’ S T H E D I F F E R E N C E ?
build create W O R D C A M P C H I C A G O
F I LT E R S
• Applying changes to
content/data
• Uses functions:
• apply_filters()
• add_filters()
A C T I O N S
• Hooks your functions into
an action in WP
• Uses functions:
• do_action()
• add_action()
build create W O R D C A M P C H I C A G O
F I LT E R S
• Change something you’re
pulling out of WP
• Change something you’re
putting into the WP database
A C T I O N S
• Using WP Ajax
• Tying into existing WP
processes, like sending email
• Adding styles or js to the
page
W H E N S H O U L D W E U S E T H E S E
L O V E LY H O O K S ?
build create W O R D C A M P C H I C A G O
A K A A L L T H E D A M N T I M E .
I T ’ S F R E A K I N G M A G I C P E O P L E .
build create W O R D C A M P C H I C A G O
S O , L E T S M A K E S O M E M A G I C …
build create W O R D C A M P C H I C A G O
I N Y O U R T E M P L A T E F I L E
I N Y O U R F U N C T I O N S F I L E
L E T S M A K E A N A C T I O N !
build create W O R D C A M P C H I C A G O
I N Y O U R F U N C T I O N S F I L E
L E T S F I LT E R T H E C O N T E N T !
( Y E A H I T ’ S T H AT S I M P L E , A N D T H I S I S L I K E 

9 0 % O F W H AT I U S E F I LT E R S F O R )
build create W O R D C A M P C H I C A G O
L E T S G E T D A N G E R O U S
build create W O R D C A M P C H I C A G O
A D D I N G D A N C I N G O L D P E O P L E T O T H E PA G E I S
F U N , B U T H O W A B O U T S O M E T H I N G Y O U C A N
A C T U A L LY U S E …
Adding our JS to the
footer with the wp_footer
hook
Tying into the WP Ajax
hooks and creating our
callback
build create W O R D C A M P C H I C A G O
L E T S M A K E O U R O W N F I LT E R , S T Y L E A N A R R AY,
T H E N A P P LY A N O T H E R F I LT E R T O T H AT F I LT E R ,
T H E N S P I T I T A L L O U T O N T H E PA G E …
Filters, not just for strings any
more. Let’s format the hell out
of this array!
Take note of the priority
difference between the filters!
Now in our page template we
can feed some content into the
filter and get the result back.
build create W O R D C A M P C H I C A G O
WA N T T O A D D A S E A R C H F O R M T O Y O U R
M A I N N AV ? T H E R E ’ S A H O O K F O R T H AT.
We get the menu HTML from WordPress, and simply append our search form
and return the result.
build create W O R D C A M P C H I C A G O
M E O W W E ’ R E TA L K I N !
build create W O R D C A M P C H I C A G O
N O W Y O U ’ R E T H I N K I N G W I T H H O O K S
• Magical WP-friendly ajax requests!
• Work WITH plugins as the author
intended instead of hacking them!
• GTFO WP core files!
• Build better themes and child
themes!
• ????
• Profit!
build create W O R D C A M P C H I C A G O
T H A N K S F O R C O M I N G !
• http://codex.wordpress.org/Plugin_API/Action_Reference
• http://code.tutsplus.com/articles/the-beginners-guide-to-
wordpress-actions-and-filters--wp-27373
• http://www.zell-weekeat.com/wordpress-actions-and-filters/
• http://codex.wordpress.org/Plugin_API/Filter_Reference
R E S O U R C E S
build create W O R D C A M P C H I C A G O

More Related Content

What's hot

Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
Clarissa Peterson
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScript
Aaron Peters
 
The Death of Lorem Ipsum & Pixel Perfect Content
The Death of Lorem Ipsum & Pixel Perfect ContentThe Death of Lorem Ipsum & Pixel Perfect Content
The Death of Lorem Ipsum & Pixel Perfect Content
Dave Olsen
 
Daniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
Daniele Rutigliano - Case history: SEO, 404 e URL Key su MagentoDaniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
Daniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
Meet Magento Italy
 
Why do I love and hate php?
Why do I love and hate php?Why do I love and hate php?
Why do I love and hate php?
Łukasz Chruściel
 
Responsive Design Workshop
Responsive Design WorkshopResponsive Design Workshop
Responsive Design Workshop
Clarissa Peterson
 
Book Trailers: How to Create Them and Capture Attention
Book Trailers: How to Create Them and Capture AttentionBook Trailers: How to Create Them and Capture Attention
Book Trailers: How to Create Them and Capture Attention
Naomi Bates
 
Don’t Panic: How To Troubleshoot Your WordPress Site
Don’t Panic: How To Troubleshoot Your WordPress SiteDon’t Panic: How To Troubleshoot Your WordPress Site
Don’t Panic: How To Troubleshoot Your WordPress Site
WordCamp Sydney
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1
Jesse Thomas
 
Creating Book Trailers
Creating Book TrailersCreating Book Trailers
Creating Book Trailers
Naomi Bates
 
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
Anthony Williams
 
Google become a subsidiary of a new company alphabet
Google become a subsidiary of a new company alphabetGoogle become a subsidiary of a new company alphabet
Google become a subsidiary of a new company alphabet
Holidayzqq
 
Extending the Blog Beyond the Blog
Extending the Blog Beyond the BlogExtending the Blog Beyond the Blog
Extending the Blog Beyond the BlogDan Zarrella
 
Basic tutorial how to use google calendar
Basic tutorial how to use google calendarBasic tutorial how to use google calendar
Basic tutorial how to use google calendar
Cherrylin Ramos
 
Basic tutorial how to use google docs
Basic tutorial how to use google docsBasic tutorial how to use google docs
Basic tutorial how to use google docs
Cherrylin Ramos
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Dre Armeda
 
Ppk on javascript_chapter_1
Ppk on javascript_chapter_1Ppk on javascript_chapter_1
Ppk on javascript_chapter_1
Da Zhao
 
Grayson abc copy
Grayson abc copyGrayson abc copy
Grayson abc copy
bcsengage
 
Squarespace Intro Class - 10082015
Squarespace Intro Class - 10082015Squarespace Intro Class - 10082015
Squarespace Intro Class - 10082015
Judy Wilson
 
Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
Nicole Sullivan
 

What's hot (20)

Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScript
 
The Death of Lorem Ipsum & Pixel Perfect Content
The Death of Lorem Ipsum & Pixel Perfect ContentThe Death of Lorem Ipsum & Pixel Perfect Content
The Death of Lorem Ipsum & Pixel Perfect Content
 
Daniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
Daniele Rutigliano - Case history: SEO, 404 e URL Key su MagentoDaniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
Daniele Rutigliano - Case history: SEO, 404 e URL Key su Magento
 
Why do I love and hate php?
Why do I love and hate php?Why do I love and hate php?
Why do I love and hate php?
 
Responsive Design Workshop
Responsive Design WorkshopResponsive Design Workshop
Responsive Design Workshop
 
Book Trailers: How to Create Them and Capture Attention
Book Trailers: How to Create Them and Capture AttentionBook Trailers: How to Create Them and Capture Attention
Book Trailers: How to Create Them and Capture Attention
 
Don’t Panic: How To Troubleshoot Your WordPress Site
Don’t Panic: How To Troubleshoot Your WordPress SiteDon’t Panic: How To Troubleshoot Your WordPress Site
Don’t Panic: How To Troubleshoot Your WordPress Site
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1
 
Creating Book Trailers
Creating Book TrailersCreating Book Trailers
Creating Book Trailers
 
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
The Multipack Presents: "Wrestling With Asp.Net And Web Standards" by Anthony...
 
Google become a subsidiary of a new company alphabet
Google become a subsidiary of a new company alphabetGoogle become a subsidiary of a new company alphabet
Google become a subsidiary of a new company alphabet
 
Extending the Blog Beyond the Blog
Extending the Blog Beyond the BlogExtending the Blog Beyond the Blog
Extending the Blog Beyond the Blog
 
Basic tutorial how to use google calendar
Basic tutorial how to use google calendarBasic tutorial how to use google calendar
Basic tutorial how to use google calendar
 
Basic tutorial how to use google docs
Basic tutorial how to use google docsBasic tutorial how to use google docs
Basic tutorial how to use google docs
 
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre ArmedaReno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
Reno-Tahoe WordCamp 2011 - WordPress End User Security - Dre Armeda
 
Ppk on javascript_chapter_1
Ppk on javascript_chapter_1Ppk on javascript_chapter_1
Ppk on javascript_chapter_1
 
Grayson abc copy
Grayson abc copyGrayson abc copy
Grayson abc copy
 
Squarespace Intro Class - 10082015
Squarespace Intro Class - 10082015Squarespace Intro Class - 10082015
Squarespace Intro Class - 10082015
 
Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
 

Viewers also liked

WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011
Dre Armeda
 
BuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhillyBuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhilly
Timothy F McKenna
 
Maintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress DeveloperMaintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress Developer
DevinVinson
 
The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!
Denise (Dee) Teal
 
Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisBrian Richards
 
WCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPressWCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPress
Joe Casabona
 
WorryProof WordPress - Backup Strategies for Your Web Site
WorryProof WordPress - Backup Strategies for Your Web SiteWorryProof WordPress - Backup Strategies for Your Web Site
WorryProof WordPress - Backup Strategies for Your Web Site
Nathan Ingram
 
THE WORDPRESS DASHBOARD DEMYSTIFIED
THE WORDPRESS DASHBOARD DEMYSTIFIEDTHE WORDPRESS DASHBOARD DEMYSTIFIED
THE WORDPRESS DASHBOARD DEMYSTIFIED
BobWP.com
 
Using Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and HowUsing Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and How
Adam W. Warner
 
WordPress Security & Backups 101
WordPress Security & Backups 101WordPress Security & Backups 101
WordPress Security & Backups 101
Maeve Lander
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWF
Tim Plummer
 
Personal Branding através dos Blogs
Personal Branding através dos BlogsPersonal Branding através dos Blogs
Personal Branding através dos Blogs
Priscilla Saldanha
 
Future of wordpress in Nashville
Future of wordpress in NashvilleFuture of wordpress in Nashville
Future of wordpress in Nashville
Ah So Designs
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
ryngrn
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve Mortiboy
Steve Mortiboy
 
Using Web Fonts in WordPress
Using Web Fonts in WordPress Using Web Fonts in WordPress
Using Web Fonts in WordPress
Tadpole Collective
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMS
Matthew Vaccaro
 
Stop Creating Data For Sake of Creating Data
Stop Creating Data For Sake of Creating DataStop Creating Data For Sake of Creating Data
Stop Creating Data For Sake of Creating Data
George Ortiz
 
Wcoc preso
Wcoc presoWcoc preso
Wcoc preso
Alex Vasquez
 
Scoping and Estimating WordPress Projects as an Agency
Scoping and Estimating WordPress Projects as an AgencyScoping and Estimating WordPress Projects as an Agency
Scoping and Estimating WordPress Projects as an Agency
Kara Hansen
 

Viewers also liked (20)

WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011WordPress End-User Security - WordCamp Las Vegas 2011
WordPress End-User Security - WordCamp Las Vegas 2011
 
BuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhillyBuddyPress Presentation - WCPhilly
BuddyPress Presentation - WCPhilly
 
Maintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress DeveloperMaintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress Developer
 
The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!The WordPress Project; It's all about YOU!
The WordPress Project; It's all about YOU!
 
Developing for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do ThisDeveloping for Success -or- Any Fool Can Do This
Developing for Success -or- Any Fool Can Do This
 
WCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPressWCCHS: Responsive Design with WordPress
WCCHS: Responsive Design with WordPress
 
WorryProof WordPress - Backup Strategies for Your Web Site
WorryProof WordPress - Backup Strategies for Your Web SiteWorryProof WordPress - Backup Strategies for Your Web Site
WorryProof WordPress - Backup Strategies for Your Web Site
 
THE WORDPRESS DASHBOARD DEMYSTIFIED
THE WORDPRESS DASHBOARD DEMYSTIFIEDTHE WORDPRESS DASHBOARD DEMYSTIFIED
THE WORDPRESS DASHBOARD DEMYSTIFIED
 
Using Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and HowUsing Curated Content in WordPress - Why and How
Using Curated Content in WordPress - Why and How
 
WordPress Security & Backups 101
WordPress Security & Backups 101WordPress Security & Backups 101
WordPress Security & Backups 101
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWF
 
Personal Branding através dos Blogs
Personal Branding através dos BlogsPersonal Branding através dos Blogs
Personal Branding através dos Blogs
 
Future of wordpress in Nashville
Future of wordpress in NashvilleFuture of wordpress in Nashville
Future of wordpress in Nashville
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve Mortiboy
 
Using Web Fonts in WordPress
Using Web Fonts in WordPress Using Web Fonts in WordPress
Using Web Fonts in WordPress
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMS
 
Stop Creating Data For Sake of Creating Data
Stop Creating Data For Sake of Creating DataStop Creating Data For Sake of Creating Data
Stop Creating Data For Sake of Creating Data
 
Wcoc preso
Wcoc presoWcoc preso
Wcoc preso
 
Scoping and Estimating WordPress Projects as an Agency
Scoping and Estimating WordPress Projects as an AgencyScoping and Estimating WordPress Projects as an Agency
Scoping and Estimating WordPress Projects as an Agency
 

Similar to Understanding WordPress Filters and Actions

Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016
Ian Wilson
 
BuddyPress & Higher Education
BuddyPress & Higher EducationBuddyPress & Higher Education
BuddyPress & Higher Education
David Bisset
 
Building Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPressBuilding Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPress
David Bisset
 
Great SEO made simple
Great SEO made simple Great SEO made simple
Great SEO made simple
Richard Jaggs
 
Serverless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPressServerless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPress
Hidetaka Okamoto
 
The Advanced Guide to SEO
The Advanced Guide to SEOThe Advanced Guide to SEO
The Advanced Guide to SEO
Calvin Nguyen
 
Advanced seo guide
Advanced seo guideAdvanced seo guide
Advanced seo guide
Connecticut SEO Experts
 
120888 advanced seo g
120888 advanced seo g120888 advanced seo g
120888 advanced seo g
isaivarigal.com
 
SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindChris Johnson
 
Firebase Login Function
Firebase Login FunctionFirebase Login Function
Firebase Login Function
Wing Yiu Ng
 
Elevated.com's 2018 General Capabilities Deck-We are growing!!
Elevated.com's 2018 General Capabilities Deck-We are growing!!Elevated.com's 2018 General Capabilities Deck-We are growing!!
Elevated.com's 2018 General Capabilities Deck-We are growing!!
Chris Snook
 
Delight Your Customers with Modern SEO
Delight Your Customers with Modern SEODelight Your Customers with Modern SEO
Delight Your Customers with Modern SEO
Charlotte Han
 
Lessons in Appstore Optimization from the Amazon Appstore | Mike Hines
Lessons in Appstore Optimization from the Amazon Appstore | Mike HinesLessons in Appstore Optimization from the Amazon Appstore | Mike Hines
Lessons in Appstore Optimization from the Amazon Appstore | Mike Hines
Jessica Tams
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
Ilia Idakiev
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
Ronald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
Ronald Ashri
 
Offline-first: Making your app resilient to network failures
Offline-first: Making your app resilient to network failuresOffline-first: Making your app resilient to network failures
Offline-first: Making your app resilient to network failures
Pedro Teixeira
 
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} #Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03}
Dimitar Danailov
 
Pitch deck example
Pitch deck examplePitch deck example
Pitch deck example
DenysKugno
 

Similar to Understanding WordPress Filters and Actions (20)

Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016
 
BuddyPress & Higher Education
BuddyPress & Higher EducationBuddyPress & Higher Education
BuddyPress & Higher Education
 
Building Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPressBuilding Next Generation Applications With BuddyPress
Building Next Generation Applications With BuddyPress
 
Great SEO made simple
Great SEO made simple Great SEO made simple
Great SEO made simple
 
Serverless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPressServerless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPress
 
BuddyPress v4
BuddyPress v4BuddyPress v4
BuddyPress v4
 
The Advanced Guide to SEO
The Advanced Guide to SEOThe Advanced Guide to SEO
The Advanced Guide to SEO
 
Advanced seo guide
Advanced seo guideAdvanced seo guide
Advanced seo guide
 
120888 advanced seo g
120888 advanced seo g120888 advanced seo g
120888 advanced seo g
 
SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mind
 
Firebase Login Function
Firebase Login FunctionFirebase Login Function
Firebase Login Function
 
Elevated.com's 2018 General Capabilities Deck-We are growing!!
Elevated.com's 2018 General Capabilities Deck-We are growing!!Elevated.com's 2018 General Capabilities Deck-We are growing!!
Elevated.com's 2018 General Capabilities Deck-We are growing!!
 
Delight Your Customers with Modern SEO
Delight Your Customers with Modern SEODelight Your Customers with Modern SEO
Delight Your Customers with Modern SEO
 
Lessons in Appstore Optimization from the Amazon Appstore | Mike Hines
Lessons in Appstore Optimization from the Amazon Appstore | Mike HinesLessons in Appstore Optimization from the Amazon Appstore | Mike Hines
Lessons in Appstore Optimization from the Amazon Appstore | Mike Hines
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
Offline-first: Making your app resilient to network failures
Offline-first: Making your app resilient to network failuresOffline-first: Making your app resilient to network failures
Offline-first: Making your app resilient to network failures
 
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} #Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03}
 
Pitch deck example
Pitch deck examplePitch deck example
Pitch deck example
 

Recently uploaded

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 

Recently uploaded (20)

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 

Understanding WordPress Filters and Actions

  • 1. build create W O R D C A M P C H I C A G O W O R D P R E S S F I LT E R S & A C T I O N S U N D E R S TA N D I N G build create W O R D C A M P C H I C A G O
  • 2. build create W O R D C A M P C H I C A G O H I . Designer, developer, marketer, shit-talker, etc. Owner build/create studios @buildcreate @wilsonography
 buildcreate.com I ’ M I A N , N I C E T O M E E T Y O U .
  • 3. build create W O R D C A M P C H I C A G O M Y S E L F I S H G O A L S F O R Y O U I want you to walk away from this feeling a little less hacky, a little more informed, and most of all inspired. I want you to have an “Ah ha!” moment, where suddenly your understanding of WordPress becomes that much clearer, and you can’t wait to get out of this room to try out your new knowledge. Here goes nothing…
  • 4. build create W O R D C A M P C H I C A G O A W O R L D W I T H O U T H O O K S
  • 5. build create W O R D C A M P C H I C A G O I T ’ S P R E T T Y D A M N H A C K Y • Including extra PHP files for ajax requests • Hacking into plugins to change display/functionality • Hacking *gasp* WP core files • Hacking theme files (when you should be using a child theme) • Hackity hack hack hack.
  • 6. build create W O R D C A M P C H I C A G O L E T ’ S TA L K A B O U T H O O K S “Hooks enable us to literally hook into parts of the WordPress page lifecycle to retrieve, insert, or modify data, or they allow us to take certain actions behind the scenes.”
 - T O M M C FA R L I N @ T U T S P L U S
  • 7. build create W O R D C A M P C H I C A G O Where does all of this fit into the WP loading process?
  • 8. build create W O R D C A M P C H I C A G O S O T H E Y ’ R E B O T H H O O K S , T H E Y C A N K E E P M E F R O M H A C K I N G M Y W O R D P R E S S I N S TA L L T O S H R E D S W I T H M Y I N E P T I T U D E , I G E T T H AT, W H AT ’ S T H E D I F F E R E N C E ?
  • 9. build create W O R D C A M P C H I C A G O F I LT E R S • Applying changes to content/data • Uses functions: • apply_filters() • add_filters() A C T I O N S • Hooks your functions into an action in WP • Uses functions: • do_action() • add_action()
  • 10. build create W O R D C A M P C H I C A G O F I LT E R S • Change something you’re pulling out of WP • Change something you’re putting into the WP database A C T I O N S • Using WP Ajax • Tying into existing WP processes, like sending email • Adding styles or js to the page W H E N S H O U L D W E U S E T H E S E L O V E LY H O O K S ?
  • 11. build create W O R D C A M P C H I C A G O A K A A L L T H E D A M N T I M E . I T ’ S F R E A K I N G M A G I C P E O P L E .
  • 12. build create W O R D C A M P C H I C A G O S O , L E T S M A K E S O M E M A G I C …
  • 13. build create W O R D C A M P C H I C A G O I N Y O U R T E M P L A T E F I L E I N Y O U R F U N C T I O N S F I L E L E T S M A K E A N A C T I O N !
  • 14. build create W O R D C A M P C H I C A G O I N Y O U R F U N C T I O N S F I L E L E T S F I LT E R T H E C O N T E N T ! ( Y E A H I T ’ S T H AT S I M P L E , A N D T H I S I S L I K E 
 9 0 % O F W H AT I U S E F I LT E R S F O R )
  • 15. build create W O R D C A M P C H I C A G O L E T S G E T D A N G E R O U S
  • 16. build create W O R D C A M P C H I C A G O A D D I N G D A N C I N G O L D P E O P L E T O T H E PA G E I S F U N , B U T H O W A B O U T S O M E T H I N G Y O U C A N A C T U A L LY U S E … Adding our JS to the footer with the wp_footer hook Tying into the WP Ajax hooks and creating our callback
  • 17. build create W O R D C A M P C H I C A G O L E T S M A K E O U R O W N F I LT E R , S T Y L E A N A R R AY, T H E N A P P LY A N O T H E R F I LT E R T O T H AT F I LT E R , T H E N S P I T I T A L L O U T O N T H E PA G E … Filters, not just for strings any more. Let’s format the hell out of this array! Take note of the priority difference between the filters! Now in our page template we can feed some content into the filter and get the result back.
  • 18. build create W O R D C A M P C H I C A G O WA N T T O A D D A S E A R C H F O R M T O Y O U R M A I N N AV ? T H E R E ’ S A H O O K F O R T H AT. We get the menu HTML from WordPress, and simply append our search form and return the result.
  • 19. build create W O R D C A M P C H I C A G O M E O W W E ’ R E TA L K I N !
  • 20. build create W O R D C A M P C H I C A G O N O W Y O U ’ R E T H I N K I N G W I T H H O O K S • Magical WP-friendly ajax requests! • Work WITH plugins as the author intended instead of hacking them! • GTFO WP core files! • Build better themes and child themes! • ???? • Profit!
  • 21. build create W O R D C A M P C H I C A G O T H A N K S F O R C O M I N G !
  • 22. • http://codex.wordpress.org/Plugin_API/Action_Reference • http://code.tutsplus.com/articles/the-beginners-guide-to- wordpress-actions-and-filters--wp-27373 • http://www.zell-weekeat.com/wordpress-actions-and-filters/ • http://codex.wordpress.org/Plugin_API/Filter_Reference R E S O U R C E S build create W O R D C A M P C H I C A G O