From f84c92fa5238a0c6cf1407fcc5c24ed4a3c8e7d1 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:35:06 +0200 Subject: [PATCH] Move chapter actions and footer to hooks --- ACTIONS.md | 2 + includes/functions/hooks/_chapter_hooks.php | 54 +++++++++++++++++++++ single-fcn_chapter.php | 28 +---------- 3 files changed, 58 insertions(+), 26 deletions(-) diff --git a/ACTIONS.md b/ACTIONS.md index 3291afd3..fbdaf988 100644 --- a/ACTIONS.md +++ b/ACTIONS.md @@ -392,6 +392,7 @@ Fires right after the content section in the `single-fcn_chapter.php` template, **Hooked Actions:** * `fictioneer_chapter_afterword( $args )` – Chapter afterword. Priority 10. * `fictioneer_chapter_support_links( $args )` – Support links set for the chapter/story/author. Priority 20. +* `fictioneer_chapter_footer( $args )` – Chapter footer. Priority 99. --- @@ -435,6 +436,7 @@ Fires between the top actions sections and chapter header (title and authors) in * $next_index (int|boolean) – Index of next chapter or false if outside bounds. **Hooked Actions:** +* `fictioneer_chapter_top_actions( $args )` – Chapter top action row. Priority 1. * `fictioneer_chapter_global_note( $args )` – Story-wide note if provided. Priority 5. * `fictioneer_chapter_foreword( $args )` – Chapter foreword if provided. Priority 10. * `fictioneer_chapter_warnings( $args )` – Chapter warnings if provided. Priority 20. diff --git a/includes/functions/hooks/_chapter_hooks.php b/includes/functions/hooks/_chapter_hooks.php index e1fdc753..4c5936dd 100644 --- a/includes/functions/hooks/_chapter_hooks.php +++ b/includes/functions/hooks/_chapter_hooks.php @@ -83,6 +83,60 @@ function fictioneer_chapters_list( $args ) { } add_action( 'fictioneer_chapters_after_content', 'fictioneer_chapters_list', 30 ); +// ============================================================================= +// CHAPTER ACTIONS +// ============================================================================= + +/** + * Outputs the HTML for the chapter top actions + * + * @since 5.21.2 + * + * @param array $args Hook args passed-through. + */ + +function fictioneer_chapter_top_actions( $args ) { + // Start HTML ---> ?> +
+
+
+
+
+ ?> + + " data-author-id="" class="chapter__article padding-left padding-right " data-age-rating=""> -
-
-
-
-
- - -