Your SlideShare is downloading. ×
0
BEYOND WP-CONTENT
    WordCamp Raleigh | 2010
        @glennansley
PURPOSE
PURPOSE
•WordPress file structure
PURPOSE
•WordPress file structure
•WordPress programing logic
PURPOSE
•WordPress file structure
•WordPress programing logic
•Web and not-web resources
WORDPRESS FILE STRUCTURE
Root Directory
This is the starting point for your file system

•Notable Files
 •index.php
 •wp-co...
WORDPRESS FILE STRUCTURE
Root Directory
This is the starting point for your file system

•Notable Folders
 •wp-content
 •wp...
WORDPRESS FILE STRUCTURE
WP-Content
This is folder contains all the files unique to your site.
•Notable Folders
 •plugins
 ...
WORDPRESS FILE STRUCTURE
WP Admin
This is the location for almost everything admin related.
•Notable Files
 •admin.php
 •a...
WORDPRESS FILE STRUCTURE
WP Admin
This is the location for almost everything admin related.
•Notable Folders          •Not...
WORDPRESS FILE STRUCTURE
WP-INCLUDES
This folder contains most of the heavy lifting for WP
•Notable Files
 •class-http.php...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
WordPress Programming Logic
  How does PHP traverse the WP file structure?
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   The first file is loaded, check...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   The first file is loaded, check...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   The first file is loaded, check...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   The first file is loaded, check...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •       The first file is loaded, c...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •       The first file is loaded, c...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   wp-blog-header.php is a great...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   wp-blog-header.php is a great...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   wp-blog-header.php is a great...
WordPress Programming Logic
  How does PHP traverse the WP file structure?
               •   wp-blog-header.php is a great...
WordPress Programming Logic
Quick review so far
WordPress Programming Logic
Quick review so far
•WordPress is made up of several files organized in folders.
WordPress Programming Logic
Quick review so far
•WordPress is made up of several files organized in folders.
•/wp-content i...
WordPress Programming Logic
Quick review so far
•WordPress is made up of several files organized in folders.
•/wp-content i...
WordPress Programming Logic
What happens as PHP traverses the WP file structure?
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Includes requested PHP scripts.
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Includes requested PHP scripts.
•Loa...
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Includes requested PHP scripts.
•Loa...
WordPress Programming Logic
What happens as PHP traverses the WP file structure?
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Invokes actions on the data in your ...
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Invokes actions on the data in your ...
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Invokes actions on the data in your ...
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Invokes actions on the data in your ...
WordPress Programming Logic
    What happens as PHP traverses the WP file structure?

•Invokes actions on the data in your ...
WordPress Programming Logic
Common errors based on a weak grasp of this behavior
WordPress Programming Logic
   Common errors based on a weak grasp of this behavior


•Undefined data (objects, variables, ...
WordPress Programming Logic
   Common errors based on a weak grasp of this behavior


•Undefined data (objects, variables, ...
WordPress Programming Logic
   Common errors based on a weak grasp of this behavior


•Undefined data (objects, variables, ...
WordPress Programming Logic
   Common errors based on a weak grasp of this behavior


•Undefined data (objects, variables, ...
WordPress Programming Logic
   Common errors based on a weak grasp of this behavior


•Undefined data (objects, variables, ...
My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
              become a more efficient...
My Tipping Point MVPs
  Some of the most helpful aspects of WP core that have helped me
                become a more effic...
My Tipping Point MVPs
  Some of the most helpful aspects of WP core that have helped me
                become a more effic...
My Tipping Point MVPs
  Some of the most helpful aspects of WP core that have helped me
                become a more effic...
My Tipping Point MVPs
  Some of the most helpful aspects of WP core that have helped me
                become a more effic...
My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
              become a more efficient...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
   Some of the most helpful aspects of WP core that have helped me
                 become a more ef...
My Tipping Point MVPs
   Some of the most helpful aspects of WP core that have helped me
                 become a more ef...
My Tipping Point MVPs
   Some of the most helpful aspects of WP core that have helped me
                 become a more ef...
My Tipping Point MVPs
   Some of the most helpful aspects of WP core that have helped me
                 become a more ef...
My Tipping Point MVPs
Some of the most helpful aspects of WP core that have helped me
              become a more efficient...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
 Some of the most helpful aspects of WP core that have helped me
               become a more efficie...
My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
         helped me become a more effic...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
Some of the most helpful aspects of the WP community that have
         helped me become a more effic...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
My Tipping Point MVPs
  Some of the most helpful aspects of the WP community that have
           helped me become a more ...
BEYOND WP-CONTENT
    WordCamp Raleigh | 2010
        @glennansley
Upcoming SlideShare
Loading in...5
×

Beyond WP-CONTENT | #WCRaleigh

1,890

Published on

A technical overview of the WordPress core files with the purpose of making you a more efficient developer

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,890
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide






































































  • Transcript of "Beyond WP-CONTENT | #WCRaleigh"

    1. 1. BEYOND WP-CONTENT WordCamp Raleigh | 2010 @glennansley
    2. 2. PURPOSE
    3. 3. PURPOSE •WordPress file structure
    4. 4. PURPOSE •WordPress file structure •WordPress programing logic
    5. 5. PURPOSE •WordPress file structure •WordPress programing logic •Web and not-web resources
    6. 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. 7. WORDPRESS FILE STRUCTURE Root Directory This is the starting point for your file system •Notable Folders •wp-content •wp-includes •wp-admin
    8. 8. WORDPRESS FILE STRUCTURE WP-Content This is folder contains all the files unique to your site. •Notable Folders •plugins •themes •uploads •upgrades
    9. 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. 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. 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
    12. 12. WordPress Programming Logic How does PHP traverse the WP file structure?
    13. 13. WordPress Programming Logic How does PHP traverse the WP file structure?
    14. 14. WordPress Programming Logic How does PHP traverse the WP file structure? • The first file is loaded, checked for errors, and processed
    15. 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. 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. 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. 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. 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.
    20. 20. WordPress Programming Logic How does PHP traverse the WP file structure?
    21. 21. WordPress Programming Logic How does PHP traverse the WP file structure? • wp-blog-header.php is a great reference for this illustration.
    22. 22. WordPress Programming Logic How does PHP traverse the WP file structure? • wp-blog-header.php is a great reference for this illustration.
    23. 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. 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
    25. 25. WordPress Programming Logic Quick review so far
    26. 26. WordPress Programming Logic Quick review so far •WordPress is made up of several files organized in folders.
    27. 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. 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.
    29. 29. WordPress Programming Logic What happens as PHP traverses the WP file structure?
    30. 30. WordPress Programming Logic What happens as PHP traverses the WP file structure? •Includes requested PHP scripts.
    31. 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. 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
    33. 33. WordPress Programming Logic What happens as PHP traverses the WP file structure?
    34. 34. WordPress Programming Logic What happens as PHP traverses the WP file structure? •Invokes actions on the data in your server’s memory
    35. 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. 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. 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. 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
    39. 39. WordPress Programming Logic Common errors based on a weak grasp of this behavior
    40. 40. WordPress Programming Logic Common errors based on a weak grasp of this behavior •Undefined data (objects, variables, constants, etc)
    41. 41. WordPress Programming Logic Common errors based on a weak grasp of this behavior •Undefined data (objects, variables, constants, etc) •Undefined functions
    42. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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/
    83. 83. BEYOND WP-CONTENT WordCamp Raleigh | 2010 @glennansley
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×