Skip to content

Instantly share code, notes, and snippets.

@haicu
Created November 24, 2016 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haicu/c613fa0ddfa678339a79747e0b916ef4 to your computer and use it in GitHub Desktop.
Save haicu/c613fa0ddfa678339a79747e0b916ef4 to your computer and use it in GitHub Desktop.
TTB action hook sidebar
// code to add to functions.php
/**
* Define the action hook.
*/
function sidebar_bottom_hook() {
do_action( 'sidebar_bottom_hook' );
}
/**
* Attach some function to the hook
*/
add_action( 'sidebar_bottom_hook', 'sidebar_action_example' );
function sidebar_action_example() {
echo '<div>This is a some content added to the bottom of the sidebar using the sidebar_bottom_hook.</div>';
}
// code to place the hook in the sidebar
<?php sidebar_bottom_hook(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment