Add fictioneer_post_article_open action hook

This commit is contained in:
Tetrakern 2024-10-14 11:40:05 +02:00
parent 554b39d062
commit b769bcd5a4
3 changed files with 16 additions and 0 deletions

View File

@ -832,6 +832,18 @@ Fires right after the article content in the `_post.php` partial and `single-pos
---
### `do_action( 'fictioneer_post_article_open', $post_id, $args )`
Fires right after the post article is opened in the `_post.php` partial and `single-post.php` template, before anything else is rendered. Mind the render context, which can be `'loop'`, `'shortcode_fictioneer_blog'`, or `'single-post'`.
**Parameter:**
* $post_id (int) The ID of the post.
**$args:**
* `context` (string) Render context of the partial.
* `nested` (boolean|null) Optional. Whether the post is nested inside another query.
---
### `do_action( 'fictioneer_post_footer_left', $post_id, $args )`
Fires inside the `.post__footer-left` container within the article footer in the `_post.php` partial and `single-post.php` template. Mind the render context, which can be `'loop'`, `'shortcode_fictioneer_blog'`, or `'single-post'`.

View File

@ -36,6 +36,8 @@ if (
<article id="post-<?php echo $post_id; ?>" class="post">
<?php do_action( 'fictioneer_post_article_open', $post_id, $args ); ?>
<header class="post__header">
<?php do_action( 'fictioneer_post_header_open', $post_id, $args ); ?>
<h2 class="post__title h1"><a href="<?php the_permalink(); ?>"><?php echo $title; ?></a></h2>

View File

@ -34,6 +34,8 @@ get_header();
<article id="post-<?php the_ID(); ?>" class="post__article">
<?php do_action( 'fictioneer_post_article_open', $post->ID, array( 'context' => 'single-post' ) ); ?>
<header class="post__header">
<?php do_action( 'fictioneer_post_header_open', $post->ID, array( 'context' => 'single-post' ) ); ?>
<h1 class="post__title"><?php echo $title; ?></h1>