Five events in the life of every WordPress request you should know
31
Five Events In The Life Of Every WordPress Request You Should Know Josh Pollock
-
Upload
josh-pollock -
Category
Internet
-
view
705 -
download
0
Transcript of Five events in the life of every WordPress request you should know
Actions
Do Something At This Point
do_action( 'something' );
add_action( 'something', function() {echo 'Doing Something';
});
Filters
Change Something At This Point
$something = apply_filters( 'something', 'something' );add_filter( 'something', function( $something) {
$something = 'something else';return $something
});
You've Seen This Before
add_filter( 'the_content', function( $content ) {$content .= '<a href="#">Share</a>';return $content;
}add_action( 'wp_head', function() {
echo "<script>alert( KHAAAAAAN!' ); </script>";}
Before:● muplugins_loaded● plugins_loaded● setup_theme● after_setup_themeAfter:● wp_loaded
Related Actions