Skip to content

Instantly share code, notes, and snippets.

@greatislander
Created February 5, 2018 20:06
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 greatislander/65c8c2db065211e1d7da85bcb26ad031 to your computer and use it in GitHub Desktop.
Save greatislander/65c8c2db065211e1d7da85bcb26ad031 to your computer and use it in GitHub Desktop.
Demonstration of the new action hooks in Book 2.0.
<?php
// Append content to the end of the cover page book header block.
add_action( 'pb_book_cover_after_book_header', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
// Append content to the end of the cover page table of contents block.
add_action( 'pb_book_cover_after_toc', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
// Append content to the end of the cover page book information block.
add_action( 'pb_book_cover_after_book_info', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
// Append content to the end of the cover page metadata block.
add_action( 'pb_book_cover_after_metadata', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
// Insert content before the cover page footer.
add_action( 'pb_book_cover_before_footer', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
// Insert content before a single (front matter, part, chapter, back matter) page footer.
add_action( 'pb_book_content_before_footer', function() {
printf( '<p>%s</p>', 'Content goes here.' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment