Add filter for story page identity HTML
This commit is contained in:
parent
3a7d63f9bd
commit
0164576c93
13
FILTERS.md
13
FILTERS.md
@ -1234,6 +1234,19 @@ Filters the intermediate output array of the `fictioneer_get_story_buttons( $arg
|
||||
|
||||
---
|
||||
|
||||
### `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()`).
|
||||
|
||||
**$output:**
|
||||
* $title (string) – HTML for the story title `<h1>`.
|
||||
* $meta (string) – HTML for the story author(s) meta row.
|
||||
|
||||
**Parameters:**
|
||||
* $story_id (int) – The story ID.
|
||||
* $story (array) – Array with story data from `fictioneer_get_story_data()`.
|
||||
|
||||
---
|
||||
|
||||
### `apply_filters( 'fictioneer_filter_subscribe_buttons', $buttons, $post_id, $author_id, $feed )`
|
||||
Filters the intermediate output array of the `fictioneer_get_subscribe_options( $post_id, $author_id, $feed )` function before it is imploded and returned. Normally accounts for Patreon, Ko-Fi, SubscribeStar, [Feedly](https://feedly.com/), and [Inoreader](https://www.inoreader.com/).
|
||||
|
||||
|
@ -60,14 +60,16 @@ if ( ! $thumbnail_shown ) {
|
||||
<div class="story__taxonomies-space"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="story__identity">
|
||||
<h1 class="story__identity-title"><?php echo $story['title']; ?></h1>
|
||||
<div class="story__identity-meta"><?php
|
||||
printf(
|
||||
<div class="story__identity"><?php
|
||||
$identity = [];
|
||||
$identity['title'] = '<h1 class="story__identity-title">' . $story['title'] . '</h1>';
|
||||
$identity['meta'] = '<div class="story__identity-meta">' . sprintf(
|
||||
_x( 'by %s', 'Story page: by {Author(s)}', 'fictioneer' ),
|
||||
fictioneer_get_story_author_nodes( $story_id )
|
||||
);
|
||||
) . '</div>';
|
||||
$identity = apply_filters( 'fictioneer_filter_story_identity', $identity, $story_id, $story );
|
||||
|
||||
echo implode( '', $identity );
|
||||
?></div>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
Loading…
x
Reference in New Issue
Block a user