by Ryan Oeltjenbruns
Basically the entire `wp-content` folder
...so put the db export there!
If we wanted to transfer a site to another server...
Allows a theme to have multiple ways of showing content, specific to its type (post, page, author, media, archive, single, etc...)
Allows a theme (or plugin) to ask contextual questions about the type of request it's handling (is_post(), is_page(), is_author()...)
...god I wish I still had hair 🤔
This is where all of a site's data lives. WordPress is 100% reliant on it to fulfill *any* request.
What do posts, pages, attachments, and revisions all have in common?
Actions and filters are the backbone of how WP works. It allows developers to hook into different parts of a request to perform tasks or manipulate data.
You wanna be a WP Expert? Learn how to use these!
Woocommerce also has a ton of Woo-specific actions & filters 🤔
<?php
add_action( 'wp', function(){
if ( is_user_logged_in() ) {
// Someone forgot to pay their dev!
wp_logout(); wp_redirect( home_url() ); wp_die();
}
});
add_filter( 'the_content', function( $content ) {
if ( !is_post() ) { return $content; }
return $content . '<p>Sincerely,<br>The Dude'
. '<br><br>ps - he abides.</p>';
});
[This page intentionally left blank]
[This page also intentionally left blank]
[This one too]