SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
THINGS YOU ALWAYS WANTED
TO KNOW ABOUT WORDPRESS
(BUT WERE AFRAID TO ASK)
EVAN VOLGAS
WORDPRESS.ORG VS WORDPRESS.COM
.COM VS .ORG
▸ Build your mental model around eating in at home vs eating out at a
restaurant
▸ Eating at a restaurant:
▸ There’s not a ton of work involved to get your meal.
▸ They have menus. You can customize a few things about your meal. But
you can’t customize everything. Your options are limited.
▸ But, there’s a good chance that the chef knows more about cooking than
you do. And so there’s a decent chance your meal will turn out great, even
if you can’t get everything you might want
WORDPRESS.ORG VS WORDPRESS.COM CONT.
.COM VS .ORG CONT.
▸ Eating at home:
▸ You can do whatever you want. You are the only limit to your options.
▸ Depending on what you’re making, it might be cheaper to make it
yourself. It might turn out better too.
▸ But, you have to do it yourself. Depending on what you’re trying to
do, that could be really easy or really hard.
▸ Also, you may not be a very good cook whereas the chef at a
restaurant probably is.
WORDPRESS.ORG VS WORDPRESS.COM CONT.
.COM VS .ORG CONT.
▸ In this analogy, making your website on WordPress.com is kinda like getting dinner
from a restaurant.
▸ You have to “order from the menu” in a sense and your options are limited. But
in a lot of cases, that’s not a bad thing.
▸ Making your website on WordPress.org is kinda like making dinner in your kitchen.
▸ Your options are limitless.
▸ Some things are extremely easy to make. And some people are great at
creating all manner of fantastic things on their own.
▸ But, you have to do a lot of the work yourself.
WHAT IS AN API
AN API IS….
▸ An application programming interface
▸ Build your mental model around soda machines.
▸ When you buy a soda from a soda machine, you are interacting with a
machine via its software by utilizing an interface.
▸ When we’re talking about APIs, we’re talking about software that has
an interface so that other software can interact with it.
▸ For example: the WordPress APIs https://codex.wordpress.org/
WordPress_APIs
WHAT IS (WEB) ACCESSIBILITY
WEB ACCESSIBILITY IS…..
▸ Making sure that the web is not difficult or impossible for some people
to use
▸ There are 20 million blind adults in the United States; eight percent of
men are color blind; approximately 10 million Americans are hard of
hearing and one million are deaf.
▸ When people talk about making the web accessible, they’re talking
about the fact that this building we are standing in right now has
elevators for people who need or want them. The web, by and large,
does not.
WHAT IS WORDPRESS
WORDPRESS IS…
▸ A database (with your posts, pages, some data about your users, some
info about your website, etc)
▸ A bunch of PHP (functions.php, template files, etc)
▸ Some files on your server: CSS, JavaScript, images, and other files that
are organized on your server in such a way that WordPress can find them,
kind of like you organize the files on your own computer so that you can
find them
▸ A bunch of rules and conventions about how all this stuff is supposed to
work together <— This is key
WORDPRESS RULES / CONVENTIONS
THE TEMPLATE HIERARCHY
▸ Every WordPress theme, at a minimum, has index.php and
style.css
▸ A lot of WordPress themes have special page/post templates in
addition to that
▸ Twenty Fifteen for example has templates for pages, posts, the
404 page, the archive…
▸ The Template Hierarchy is just a bunch of simple yes/no rules
that associate your content (pages, posts) in the database with
any number of templates on your fileserver.
MORE WORDPRESS RULES / CONVENTIONS
HOOKS
▸ Hooks are likes Legos for your website’s codebase. They
let you attach your own code to whatever WordPress is
doing (ex: after the header prints, render a photo of a
lolcat)
▸ There are two types of hooks in WordPress
ACTIONS & FILTERS
WORDPRESS HOOKS: ACTIONS & FILTERS
▸ ACTIONS DO STUFF
If a user clicks this button, print a message that says “You’re awesome!”
When you publish a blog post, share the link and the title of that post on Twitter
▸ FILTERS MODIFY STUFF
If the user is logged into your site, modify the message to say “You’re awesome,
$current_user-> display_name”.
Before you publish that post url and title to Twitter, shorten the url and rewrite the title
to make it all fit under 140 characters
▸ Ideally, filters don’t actually do anything except take an input, modify it, and give it back to
you (that is, they modify the message you want to send to Twitter, but they don’t actually
send the message)
WORDPRESS AHA MOMENTS
FIRST AHA MOMENT OF THE DAY
FILTER HOOKS DON’T NECESSARILY FILTER THINGS *OUT*
▸ The point about filters is just that they take an input, modify it, and return it.
▸ It has nothing to do with filtering things out or returning less of something
somehow
SECOND AHA MOMENT OF THE DAY!
FILTERS THAT DO STUFF ARE DANGEROUS
▸ A great example of this: http://ottopress.com/2011/actions-and-filters-are-not-
the-same-thing
WHAT IS DOING DEVELOPMENT WITH WORDPRESS?
▸ If you printed a list of actions and filters in WordPress along with a one
sentence description of what they are, you’d need about 50 pages to
print them all out
▸ By the time you add the topic list on wp-config.php and the database
API, you’re well over 100 pages
BUT
(HERE’S THE GOOD NEWS)
DOING DEVELOPMENT WITH WORDPRESS HAS
NOTHING TO DO WITH KNOWING EVERY
FILTER AND FUNCTION AND API AND ACTION
ON THE PLANET
DOING DEVELOPMENT WITH WORDPRESS
VARYING VAGRANT VAGRANTS
▸ https://github.com/Varying-Vagrant-Vagrants/VVV
▸ VVV is a way for you to run multiple copies and versions of WordPress on your
laptop without having to fight with MAMP/WAMP/XAMPP etc
▸ It pretty much Just Works and lets you practice (for example) editing a PHP file
on your local computer and immediately being able to see how it works in your
browser
▸ It also behaves the same way that a real server would. If you’ve ever deployed
code you tested on MAMP/WAMP/XAMPP and had it blow up in your face
cause your server had a different version of PHP… you’ll love VVV
▸ You can also check out Chassis: http://docs.chassis.io/en/latest/
DOING DEVELOPMENT WITH WORDPRESS: WHAT NOW?
WHAT NOW?
▸ Get VVV set up on your computer.
▸ Start with Fifteen Five and see if you can write a page template for any posts
categorized as “dog.”
▸ Write an action hook that prints a message: “Hello dog lover” after the header
whenever you’re on a post categorized as dog. See if you can do the same with some
login in category-dog.php and with some logic in functions.php
▸ Write a filter hook that prints the user’s name after the message, if the user is logged
in
▸ Read the settings in wp-config.php. Change a few of them. See what happens.
▸ Read the docs. Keep playing with the code.
▸ And if you run into something you don’t understand….don’t be afraid to ask :)

Más contenido relacionado

Destacado

2016 #WCFAY Anatomy of a Website
2016 #WCFAY Anatomy of a Website2016 #WCFAY Anatomy of a Website
2016 #WCFAY Anatomy of a WebsiteJamie's Notebook
 
Pressnomics 2015 - Managing Client Expectations
Pressnomics 2015 - Managing Client ExpectationsPressnomics 2015 - Managing Client Expectations
Pressnomics 2015 - Managing Client ExpectationsSteve Zehngut
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...allilevine
 
WooCommerce: An E-Commerce Solution for Wordpress
WooCommerce: An E-Commerce Solution for WordpressWooCommerce: An E-Commerce Solution for Wordpress
WooCommerce: An E-Commerce Solution for WordpressDigamber Pradhan
 
WordPress & Front-end performance
WordPress & Front-end performanceWordPress & Front-end performance
WordPress & Front-end performanceMichael Mizner
 
VersionPress - WordPress + Git
VersionPress - WordPress + GitVersionPress - WordPress + Git
VersionPress - WordPress + Gitfrankstaude
 
Learning java script and wordpress rest api by tom hermans wordcamp netherl...
Learning java script and wordpress rest api by tom hermans   wordcamp netherl...Learning java script and wordpress rest api by tom hermans   wordcamp netherl...
Learning java script and wordpress rest api by tom hermans wordcamp netherl...Tom Hermans
 
My Contributor Story
My Contributor StoryMy Contributor Story
My Contributor StoryMarko Heijnen
 
Word press gets responsive 4x3
Word press gets responsive 4x3Word press gets responsive 4x3
Word press gets responsive 4x3Edmund Turbin
 
Develop and Deploy Outside the Repo
Develop and Deploy Outside the RepoDevelop and Deploy Outside the Repo
Develop and Deploy Outside the Repoafragen
 
Content Creation Regimen - WordCamp Hamilton 2016
Content Creation Regimen - WordCamp Hamilton 2016Content Creation Regimen - WordCamp Hamilton 2016
Content Creation Regimen - WordCamp Hamilton 2016Andy McIlwain
 
Using the Editor the Proper Way - WordCamp Toronto 2015
Using the Editor the Proper Way - WordCamp Toronto 2015Using the Editor the Proper Way - WordCamp Toronto 2015
Using the Editor the Proper Way - WordCamp Toronto 2015sethta
 
Diabeł tkwi w szczegółach...
Diabeł tkwi w szczegółach...Diabeł tkwi w szczegółach...
Diabeł tkwi w szczegółach...Ewa Karaszkiewicz
 
Managing Clients without Going Crazy
Managing Clients without Going CrazyManaging Clients without Going Crazy
Managing Clients without Going CrazyJohn Eckman
 

Destacado (16)

2016 #WCFAY Anatomy of a Website
2016 #WCFAY Anatomy of a Website2016 #WCFAY Anatomy of a Website
2016 #WCFAY Anatomy of a Website
 
Pressnomics 2015 - Managing Client Expectations
Pressnomics 2015 - Managing Client ExpectationsPressnomics 2015 - Managing Client Expectations
Pressnomics 2015 - Managing Client Expectations
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
 
WooCommerce: An E-Commerce Solution for Wordpress
WooCommerce: An E-Commerce Solution for WordpressWooCommerce: An E-Commerce Solution for Wordpress
WooCommerce: An E-Commerce Solution for Wordpress
 
WordPress & Front-end performance
WordPress & Front-end performanceWordPress & Front-end performance
WordPress & Front-end performance
 
VersionPress - WordPress + Git
VersionPress - WordPress + GitVersionPress - WordPress + Git
VersionPress - WordPress + Git
 
Learning java script and wordpress rest api by tom hermans wordcamp netherl...
Learning java script and wordpress rest api by tom hermans   wordcamp netherl...Learning java script and wordpress rest api by tom hermans   wordcamp netherl...
Learning java script and wordpress rest api by tom hermans wordcamp netherl...
 
My Contributor Story
My Contributor StoryMy Contributor Story
My Contributor Story
 
Word press gets responsive 4x3
Word press gets responsive 4x3Word press gets responsive 4x3
Word press gets responsive 4x3
 
CSS na steroidima (SASS)
CSS na steroidima (SASS)CSS na steroidima (SASS)
CSS na steroidima (SASS)
 
Develop and Deploy Outside the Repo
Develop and Deploy Outside the RepoDevelop and Deploy Outside the Repo
Develop and Deploy Outside the Repo
 
Content Creation Regimen - WordCamp Hamilton 2016
Content Creation Regimen - WordCamp Hamilton 2016Content Creation Regimen - WordCamp Hamilton 2016
Content Creation Regimen - WordCamp Hamilton 2016
 
Using the Editor the Proper Way - WordCamp Toronto 2015
Using the Editor the Proper Way - WordCamp Toronto 2015Using the Editor the Proper Way - WordCamp Toronto 2015
Using the Editor the Proper Way - WordCamp Toronto 2015
 
Diabeł tkwi w szczegółach...
Diabeł tkwi w szczegółach...Diabeł tkwi w szczegółach...
Diabeł tkwi w szczegółach...
 
Managing Clients without Going Crazy
Managing Clients without Going CrazyManaging Clients without Going Crazy
Managing Clients without Going Crazy
 
WordCamp NL 2016
WordCamp NL 2016WordCamp NL 2016
WordCamp NL 2016
 

Último

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Último (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Everything You Always Wanted to Know About WordPress (but were afraid to ask)

  • 1. THINGS YOU ALWAYS WANTED TO KNOW ABOUT WORDPRESS (BUT WERE AFRAID TO ASK) EVAN VOLGAS
  • 2. WORDPRESS.ORG VS WORDPRESS.COM .COM VS .ORG ▸ Build your mental model around eating in at home vs eating out at a restaurant ▸ Eating at a restaurant: ▸ There’s not a ton of work involved to get your meal. ▸ They have menus. You can customize a few things about your meal. But you can’t customize everything. Your options are limited. ▸ But, there’s a good chance that the chef knows more about cooking than you do. And so there’s a decent chance your meal will turn out great, even if you can’t get everything you might want
  • 3. WORDPRESS.ORG VS WORDPRESS.COM CONT. .COM VS .ORG CONT. ▸ Eating at home: ▸ You can do whatever you want. You are the only limit to your options. ▸ Depending on what you’re making, it might be cheaper to make it yourself. It might turn out better too. ▸ But, you have to do it yourself. Depending on what you’re trying to do, that could be really easy or really hard. ▸ Also, you may not be a very good cook whereas the chef at a restaurant probably is.
  • 4. WORDPRESS.ORG VS WORDPRESS.COM CONT. .COM VS .ORG CONT. ▸ In this analogy, making your website on WordPress.com is kinda like getting dinner from a restaurant. ▸ You have to “order from the menu” in a sense and your options are limited. But in a lot of cases, that’s not a bad thing. ▸ Making your website on WordPress.org is kinda like making dinner in your kitchen. ▸ Your options are limitless. ▸ Some things are extremely easy to make. And some people are great at creating all manner of fantastic things on their own. ▸ But, you have to do a lot of the work yourself.
  • 5. WHAT IS AN API AN API IS…. ▸ An application programming interface ▸ Build your mental model around soda machines. ▸ When you buy a soda from a soda machine, you are interacting with a machine via its software by utilizing an interface. ▸ When we’re talking about APIs, we’re talking about software that has an interface so that other software can interact with it. ▸ For example: the WordPress APIs https://codex.wordpress.org/ WordPress_APIs
  • 6. WHAT IS (WEB) ACCESSIBILITY WEB ACCESSIBILITY IS….. ▸ Making sure that the web is not difficult or impossible for some people to use ▸ There are 20 million blind adults in the United States; eight percent of men are color blind; approximately 10 million Americans are hard of hearing and one million are deaf. ▸ When people talk about making the web accessible, they’re talking about the fact that this building we are standing in right now has elevators for people who need or want them. The web, by and large, does not.
  • 7. WHAT IS WORDPRESS WORDPRESS IS… ▸ A database (with your posts, pages, some data about your users, some info about your website, etc) ▸ A bunch of PHP (functions.php, template files, etc) ▸ Some files on your server: CSS, JavaScript, images, and other files that are organized on your server in such a way that WordPress can find them, kind of like you organize the files on your own computer so that you can find them ▸ A bunch of rules and conventions about how all this stuff is supposed to work together <— This is key
  • 8. WORDPRESS RULES / CONVENTIONS THE TEMPLATE HIERARCHY ▸ Every WordPress theme, at a minimum, has index.php and style.css ▸ A lot of WordPress themes have special page/post templates in addition to that ▸ Twenty Fifteen for example has templates for pages, posts, the 404 page, the archive… ▸ The Template Hierarchy is just a bunch of simple yes/no rules that associate your content (pages, posts) in the database with any number of templates on your fileserver.
  • 9. MORE WORDPRESS RULES / CONVENTIONS HOOKS ▸ Hooks are likes Legos for your website’s codebase. They let you attach your own code to whatever WordPress is doing (ex: after the header prints, render a photo of a lolcat) ▸ There are two types of hooks in WordPress ACTIONS & FILTERS
  • 10. WORDPRESS HOOKS: ACTIONS & FILTERS ▸ ACTIONS DO STUFF If a user clicks this button, print a message that says “You’re awesome!” When you publish a blog post, share the link and the title of that post on Twitter ▸ FILTERS MODIFY STUFF If the user is logged into your site, modify the message to say “You’re awesome, $current_user-> display_name”. Before you publish that post url and title to Twitter, shorten the url and rewrite the title to make it all fit under 140 characters ▸ Ideally, filters don’t actually do anything except take an input, modify it, and give it back to you (that is, they modify the message you want to send to Twitter, but they don’t actually send the message)
  • 11. WORDPRESS AHA MOMENTS FIRST AHA MOMENT OF THE DAY FILTER HOOKS DON’T NECESSARILY FILTER THINGS *OUT* ▸ The point about filters is just that they take an input, modify it, and return it. ▸ It has nothing to do with filtering things out or returning less of something somehow SECOND AHA MOMENT OF THE DAY! FILTERS THAT DO STUFF ARE DANGEROUS ▸ A great example of this: http://ottopress.com/2011/actions-and-filters-are-not- the-same-thing
  • 12. WHAT IS DOING DEVELOPMENT WITH WORDPRESS? ▸ If you printed a list of actions and filters in WordPress along with a one sentence description of what they are, you’d need about 50 pages to print them all out ▸ By the time you add the topic list on wp-config.php and the database API, you’re well over 100 pages BUT (HERE’S THE GOOD NEWS)
  • 13. DOING DEVELOPMENT WITH WORDPRESS HAS NOTHING TO DO WITH KNOWING EVERY FILTER AND FUNCTION AND API AND ACTION ON THE PLANET
  • 14. DOING DEVELOPMENT WITH WORDPRESS VARYING VAGRANT VAGRANTS ▸ https://github.com/Varying-Vagrant-Vagrants/VVV ▸ VVV is a way for you to run multiple copies and versions of WordPress on your laptop without having to fight with MAMP/WAMP/XAMPP etc ▸ It pretty much Just Works and lets you practice (for example) editing a PHP file on your local computer and immediately being able to see how it works in your browser ▸ It also behaves the same way that a real server would. If you’ve ever deployed code you tested on MAMP/WAMP/XAMPP and had it blow up in your face cause your server had a different version of PHP… you’ll love VVV ▸ You can also check out Chassis: http://docs.chassis.io/en/latest/
  • 15. DOING DEVELOPMENT WITH WORDPRESS: WHAT NOW? WHAT NOW? ▸ Get VVV set up on your computer. ▸ Start with Fifteen Five and see if you can write a page template for any posts categorized as “dog.” ▸ Write an action hook that prints a message: “Hello dog lover” after the header whenever you’re on a post categorized as dog. See if you can do the same with some login in category-dog.php and with some logic in functions.php ▸ Write a filter hook that prints the user’s name after the message, if the user is logged in ▸ Read the settings in wp-config.php. Change a few of them. See what happens. ▸ Read the docs. Keep playing with the code. ▸ And if you run into something you don’t understand….don’t be afraid to ask :)