diff --git a/FILTERS.md b/FILTERS.md index 371694d7..89152db9 100644 --- a/FILTERS.md +++ b/FILTERS.md @@ -1411,6 +1411,22 @@ Filters the arguments for the story chapter posts query, an utility function cal --- +### `apply_filters( 'fictioneer_filter_story_footer_meta', $meta_output, $args, $post )` +Filters the intermediate output array of story meta data in the `_story-footer.php` partial before it is imploded and rendered. Contains the status, publish date, word count, age rating, and checkmark (if enabled). + +**meta_output:** +* $status (string) – HTML snippet for the status. +* $date (string) – HTML snippet for the date. +* $words (string) – HTML snippet for the word count. +* $rating (string) – HTML snippet for the age rating. +* $checkmark (string) – HTML snippet for the checkmark. + +**Parameters:** +* $args (array) – Relevant story data: 'story_id' (int) and 'story_data' (array). +* $post (WP_Post) – The post object of the story. + +--- + ### `apply_filters( 'fictioneer_filter_story_identity', $output, $story_id, $story )` Filters the intermediate output array in the `_story-header.php` partial before it is imploded and rendered. Contains the HTML for the story title (safe) and author meta nodes (see `fictioneer_get_story_author_nodes()`). diff --git a/partials/_story-footer.php b/partials/_story-footer.php index 327b51a6..6377df91 100644 --- a/partials/_story-footer.php +++ b/partials/_story-footer.php @@ -9,6 +9,7 @@ * @package WordPress * @subpackage Fictioneer * @since 4.7.0 + * @since 5.17.0 - Turned meta data into filterable array. * @see single-fcn_story.php * * @internal $args['story_data'] Story data from fictioneer_get_story_data(). @@ -34,6 +35,27 @@ $story_id = $args['story_id']; $story = $args['story_data']; $post = get_post( $story_id ); $show_log = $story['chapter_count'] > 0 && FICTIONEER_ENABLE_STORY_CHANGELOG && get_option( 'fictioneer_show_story_changelog' ); +$meta_output = []; + +// Status +$meta_output['status'] = '
'; + +// Date +$meta_output['date'] = ' '; + +// Words +$meta_output['words'] = ' '; + +// Rating +$meta_output['rating'] = ' '; + +// Checkmark +if ( $story['chapter_count'] > 0 ) { + $meta_output['checkmark'] = ''; +} + +// Filter +$meta_output = apply_filters( 'fictioneer_filter_story_footer_meta', $meta_output, $args, $post ); ?> @@ -45,35 +67,5 @@ $show_log = $story['chapter_count'] > 0 && FICTIONEER_ENABLE_STORY_CHANGELOG && - +