Skip to content

Commit

Permalink
Restructure root directory, add hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman committed Feb 5, 2018
1 parent 578559a commit 06b7101
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 17 deletions.
4 changes: 0 additions & 4 deletions page-cover-private-block.php

This file was deleted.

25 changes: 13 additions & 12 deletions page-cover.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
get_header();

if ( pb_is_public() ) {
if ( have_posts() ) {
the_post();
}

include( locate_template( 'page-cover-top-block.php' ) );
include( locate_template( 'page-cover-second-block.php' ) );
include( locate_template( 'page-cover-third-block.php' ) );
include( locate_template( 'page-cover-fourth-block.php' ) );
} else {
include( locate_template( 'page-cover-private-block.php' ) );
}

include( locate_template( 'partials/content-cover-book-header.php' ) );
include( locate_template( 'partials/content-cover-toc.php' ) );
include( locate_template( 'partials/content-cover-book-info.php' ) );
include( locate_template( 'partials/content-cover-metadata.php' ) );
} else { ?>
<section class="block private-block">
<?php pb_private(); ?>
</section>
<?php }
/** Insert content before cover footer.
* @since 2.0.0
*/
do_action( 'pb_book_cover_before_footer' );
get_footer();
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,11 @@
}
?>
</div>
<?php
/** Append content to cover book header block.
* @since 2.0.0
*/
do_action( 'pb_book_cover_after_book_header' );
?>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
</div>
<?php } ?>
</div>
<?php
/** Append content to cover book info block.
* @since 2.0.0
*/
do_action( 'pb_book_cover_after_book_info' );
?>
</div>

<div class="block-toggle__cta">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
} ?>
</dl>
</div>
<?php
/** Append content to cover metadata block.
* @since 2.0.0
*/
do_action( 'pb_book_cover_after_metadata' );
?>
</div>
<div class="block-toggle__cta">
<a class="block-toggle__cta__button button--circle--primary js-toggle-block"><svg><use xlink:href="#arrow-down"></svg><span class="screen-reader-text"><?php _e( 'Click for more information', 'pressbooks-book' ) ?></span></a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<section class="block block-toc">
<h2 class="block__title block-toc__title"><?php _e( 'Contents', 'pressbooks-book' ); ?></h2>
<?php include( locate_template( 'partials/content-toc.php' ) ); ?>
<?php
/** Append content to cover table of contents block.
* @since 2.0.0
*/
do_action( 'pb_book_cover_after_toc' );
?>
</section>
7 changes: 6 additions & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<?php else : ?>
<?php pb_private(); ?>
<?php endif; ?>
<?php get_footer(); ?>
<?php
/** Insert content before content footer.
* @since 2.0.0
*/
do_action( 'pb_book_content_before_footer' );
get_footer(); ?>
<?php endwhile;
};?>

0 comments on commit 06b7101

Please sign in to comment.