The document discusses WordPress file structure and programming logic. It explains that WordPress files are organized into folders like wp-content and wp-includes. PHP traverses the files by including scripts, loading functions and data, invoking actions on data, and outputting HTML. Common errors can occur from undefined variables, functions, or missing hooks due to not understanding this process. The document also provides tips on helpful aspects of WordPress like hooks, functions, classes, and files that improve development efficiency.
6. WORDPRESS FILE STRUCTURE
Root Directory
This is the starting point for your file system
•Notable Files
•index.php
•wp-config.php
•wp-load.php
•xmlrpc.php
7. WORDPRESS FILE STRUCTURE
Root Directory
This is the starting point for your file system
•Notable Folders
•wp-content
•wp-includes
•wp-admin
9. WORDPRESS FILE STRUCTURE
WP Admin
This is the location for almost everything admin related.
•Notable Files
•admin.php
•admin-header.php
•options-*.php
•edit-*.php
10. WORDPRESS FILE STRUCTURE
WP Admin
This is the location for almost everything admin related.
•Notable Folders •Notable Files in /includes
•/includes •admin.php
•meta-boxes.php
•post.php
•user.php
11. WORDPRESS FILE STRUCTURE
WP-INCLUDES
This folder contains most of the heavy lifting for WP
•Notable Files
•class-http.php •functions.php
•class-phpmailer.php •general-template.php
•classes.php •pluggable.php
•default-filters.php •query.php
•formatting.php •user.php
14. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
15. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
• It hits a PHP include, loads the requested file and
processes down the script
16. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
• It hits a PHP include, loads the requested file and
processes down the script
• It in turn hits another include which processes down
through two more includes
17. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
• It hits a PHP include, loads the requested file and
processes down the script
• It in turn hits another include which processes down
through two more includes
• At this point PHP is still processing data and there are
no includes at the bottom of this file
18. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
• It hits a PHP include, loads the requested file and
processes down the script
• It in turn hits another include which processes down
through two more includes
• At this point PHP is still processing data and there are
no includes at the bottom of this file
• So PHP returns to the next line in the file we left and
continues to process to the end of that file
19. WordPress Programming Logic
How does PHP traverse the WP file structure?
• The first file is loaded, checked for errors, and processed
• It hits a PHP include, loads the requested file and
processes down the script
• It in turn hits another include which processes down
through two more includes
• At this point PHP is still processing data and there are
no includes at the bottom of this file
• So PHP returns to the next line in the file we left and
continues to process to the end of that file
• At the end of file two, PHP returns to the next line in
file one and continues to the end of the script.
21. WordPress Programming Logic
How does PHP traverse the WP file structure?
• wp-blog-header.php is a great reference for this illustration.
22. WordPress Programming Logic
How does PHP traverse the WP file structure?
• wp-blog-header.php is a great reference for this illustration.
23. WordPress Programming Logic
How does PHP traverse the WP file structure?
• wp-blog-header.php is a great reference for this illustration.
Load the data
24. WordPress Programming Logic
How does PHP traverse the WP file structure?
• wp-blog-header.php is a great reference for this illustration.
Load the data
Deliver the data
27. WordPress Programming Logic
Quick review so far
•WordPress is made up of several files organized in folders.
•/wp-content is where developers make most modifications.
28. WordPress Programming Logic
Quick review so far
•WordPress is made up of several files organized in folders.
•/wp-content is where developers make most modifications.
•PHP traverses this file structure in a logical manner, including
only what is necessary for the current action.
30. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Includes requested PHP scripts.
31. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Includes requested PHP scripts.
•Loads functions into the server’s memory
32. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Includes requested PHP scripts.
•Loads functions into the server’s memory
•Loads data into the server’s memory
•REQUESTS
•Database info
•COOKIES and SESSIONS
•CACHE
•Constants, variables, class objects
34. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Invokes actions on the data in your server’s memory
35. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Invokes actions on the data in your server’s memory
•Spitting HTML out to the browser
36. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Invokes actions on the data in your server’s memory
•Spitting HTML out to the browser
•Executing core PHP functions ( explode(), unset(), etc ).
37. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Invokes actions on the data in your server’s memory
•Spitting HTML out to the browser
•Executing core PHP functions ( explode(), unset(), etc ).
•Executing WordPress defined functions already in memory.
38. WordPress Programming Logic
What happens as PHP traverses the WP file structure?
•Invokes actions on the data in your server’s memory
•Spitting HTML out to the browser
•Executing core PHP functions ( explode(), unset(), etc ).
•Executing WordPress defined functions already in memory.
•Making remote requests to other scripts or web services
40. WordPress Programming Logic
Common errors based on a weak grasp of this behavior
•Undefined data (objects, variables, constants, etc)
41. WordPress Programming Logic
Common errors based on a weak grasp of this behavior
•Undefined data (objects, variables, constants, etc)
•Undefined functions
42. WordPress Programming Logic
Common errors based on a weak grasp of this behavior
•Undefined data (objects, variables, constants, etc)
•Undefined functions
•Undefined class properties
43. WordPress Programming Logic
Common errors based on a weak grasp of this behavior
•Undefined data (objects, variables, constants, etc)
•Undefined functions
•Undefined class properties
•Missed hooks
44. WordPress Programming Logic
Common errors based on a weak grasp of this behavior
•Undefined data (objects, variables, constants, etc)
•Undefined functions
•Undefined class properties
•Missed hooks
It’s all about the timing!
45. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Hooks
46. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Hooks
•init (action)
47. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Hooks
•init (action)
•admin_init (action)
48. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Hooks
•init (action)
•admin_init (action)
•template_redirect (action)
49. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Hooks
•init (action)
•admin_init (action)
•template_redirect (action)
•plugins_loaded (action)
50. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
51. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
•&get_posts
52. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
•&get_posts
•register_* ( importers, settings, widgets, posts, post types, taxonomies, menus )
53. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
•&get_posts
•register_* ( importers, settings, widgets, posts, post types, taxonomies, menus )
•helper functions ( get_the_title, get_permalink, etc )
54. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
•&get_posts
•register_* ( importers, settings, widgets, posts, post types, taxonomies, menus )
•helper functions ( get_the_title, get_permalink, etc )
•current_user_can
55. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Functions
•&get_posts
•register_* ( importers, settings, widgets, posts, post types, taxonomies, menus )
•helper functions ( get_the_title, get_permalink, etc )
•current_user_can
•wp_redirect
56. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
57. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
58. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
59. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
•WP_Error
60. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
•WP_Error
•Wp_Roles
61. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
•WP_Error
•Wp_Roles
•WP_Rewrite
62. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
•WP_Error
•Wp_Roles
•WP_Rewrite
•WP_Http
63. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Classes
•WP_Query
•WP_User
•WP_Error
•Wp_Roles
•WP_Rewrite
•WP_Http
•PHPMailer
64. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
65. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
•/wp-includes/pluggable.php
66. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
•/wp-includes/pluggable.php
•/wp-includes/capabilities.php
67. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
•/wp-includes/pluggable.php
•/wp-includes/capabilities.php
•/wp-includes/default-filters.php
68. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
•/wp-includes/pluggable.php
•/wp-includes/capabilities.php
•/wp-includes/default-filters.php
•/wp-includes/query.php
69. My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
become a more efficient developer
Files
•/wp-includes/pluggable.php
•/wp-includes/capabilities.php
•/wp-includes/default-filters.php
•/wp-includes/query.php
•/wp-settings.php
70. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
71. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
72. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
73. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
•http://codex.wordpress.org/Mailing_Lists
74. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
•http://codex.wordpress.org/Mailing_Lists
•http://phpdoc.wordpress.org
75. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
•http://codex.wordpress.org/Mailing_Lists
•http://phpdoc.wordpress.org
•http://twitter.com
76. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
•http://codex.wordpress.org/Mailing_Lists
•http://phpdoc.wordpress.org
•http://twitter.com
•http://wpdevel.wordpress.com/
77. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Web
•http://wordpress.org/forums
•http://codex.wordpress.org/
•http://codex.wordpress.org/Mailing_Lists
•http://phpdoc.wordpress.org
•http://twitter.com
•http://wpdevel.wordpress.com/
•#wordpress and #wordpress-dev
78. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Not Web
79. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Not Web
•WordPress for Dummies - @LisaSabinWilson
80. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Not Web
•WordPress for Dummies - @LisaSabinWilson
•The WordPress Bible - @technosailor
81. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Not Web
•WordPress for Dummies - @LisaSabinWilson
•The WordPress Bible - @technosailor
•Professional WordPress - @williamsba & @mirmillo
82. My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
helped me become a more efficient developer
Not Web
•WordPress for Dummies - @LisaSabinWilson
•The WordPress Bible - @technosailor
•Professional WordPress - @williamsba & @mirmillo
•Raleigh WP Meetup - http://meetup.com/Raleigh-WordPress-Meetup-Group/