Created
September 2, 2011 17:40
-
-
Save chipbennett/1189257 to your computer and use it in GitHub Desktop.
Example hook callback with contextual conditionals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hook into hypothetical action hook | |
*/ | |
function themeslug_after_post() { | |
// Let's only do something on | |
// single blog posts | |
if ( is_single() ) { | |
// output a hypothetical related posts function | |
related_posts(); | |
} | |
} | |
// Hook our callback into the hypothetical 'after_post' hook | |
add_action( 'after_post', 'themeslug_after_post' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment