Add action hooks to large card bodies
This commit is contained in:
parent
8c91aad588
commit
2ca1f068bd
57
ACTIONS.md
57
ACTIONS.md
@ -586,6 +586,63 @@ Fires right after opening the inner `<header>` container. Normally includes a ba
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_chapter', $post, $story_data, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-chapter.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the chapter.
|
||||
* $story_data (array|null) – Pre-processed data of the story. Unsafe.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_collection', $post, $items, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-collection.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the collection.
|
||||
* $items (array) – Array of featured WP_Post objects.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_page', $post, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-page.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the page.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_post', $post, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-post.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the post.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_recommendation', $post, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-recommendation.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the recommendation.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_large_card_body_story', $post, $story_data, $args )`
|
||||
Fires before the content of the card grid is rendered in the `partials/_card-story.php` partial. Does not allow you to change the content of the body, but you can add additional HTML and use CSS to modify the look. If you want to change significantly the cards, better overwrite the partial.
|
||||
|
||||
**Parameters:**
|
||||
* $post (WP_Post) – Post object of the story.
|
||||
* $story_data (array) – Pre-processed data of the story.
|
||||
* $args (array) – Optional arguments passed to the card.
|
||||
|
||||
---
|
||||
|
||||
### `do_action( 'fictioneer_main' )`
|
||||
Fires after opening the site’s `<main>` container, right after the `.main-observer` element.
|
||||
|
||||
|
@ -98,6 +98,9 @@ $show_taxonomies = ! get_option( 'fictioneer_hide_taxonomies_on_chapter_cards' )
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_chapter', $post, $story_data, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
|
||||
|
@ -90,6 +90,9 @@ if ( empty( $description ) ) {
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_collection', $post, $items, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
printf(
|
||||
|
@ -35,6 +35,9 @@ $comments_number = get_comments_number();
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_page', $post, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
printf(
|
||||
|
@ -36,6 +36,9 @@ $categories = wp_get_post_categories( $post->ID );
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_post', $post, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
printf(
|
||||
|
@ -64,6 +64,9 @@ $show_taxonomies = ! get_option( 'fictioneer_hide_taxonomies_on_recommendation_c
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_recommendation', $post, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
printf(
|
||||
|
@ -75,6 +75,9 @@ $is_sticky = FICTIONEER_ENABLE_STICKY_CARDS &&
|
||||
<div class="card__main _grid _large">
|
||||
|
||||
<?php
|
||||
// Action hook
|
||||
do_action( 'fictioneer_large_card_body_story', $post, $story, $args );
|
||||
|
||||
// Thumbnail
|
||||
if ( has_post_thumbnail() ) {
|
||||
printf(
|
||||
|
Loading…
x
Reference in New Issue
Block a user