From 5fd686c054dc8e6c694c16195a067f39e25b0838 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Sun, 28 Jan 2024 00:42:09 +0100 Subject: [PATCH] Add action hooks to shortcode card bodies --- ACTIONS.md | 39 ++++++++++++++++++++ partials/_latest-chapters-compact.php | 2 + partials/_latest-chapters.php | 2 + partials/_latest-recommendations-compact.php | 2 + partials/_latest-recommendations.php | 2 + partials/_latest-stories-compact.php | 2 + partials/_latest-stories.php | 2 + partials/_latest-updates-compact.php | 2 + partials/_latest-updates.php | 2 + 9 files changed, 55 insertions(+) diff --git a/ACTIONS.md b/ACTIONS.md index 47e29052..bb16ed4d 100644 --- a/ACTIONS.md +++ b/ACTIONS.md @@ -863,6 +863,45 @@ Fires right after opening the article’s no-results `
` container in th --- +### `do_action( 'fictioneer_shortcode_latest_chapters_card_body', $post, $story_data, $args )` +Fires before the content of the small card grid is rendered in the `partials/_latest-chapters*.php` partials. 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 shortcode. + +--- + +### `do_action( 'fictioneer_shortcode_latest_recommendations_card_body', $post, $args )` +Fires before the content of the small card grid is rendered in the `partials/_latest-recommendations*.php` partials. 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 shortcode. + +--- + +### `do_action( 'fictioneer_shortcode_latest_stories_card_body', $post, $story_data, $args )` +Fires before the content of the small card grid is rendered in the `partials/_latest-stories*.php` partials. 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 shortcode. + +--- + +### `do_action( 'fictioneer_shortcode_latest_updates_card_body', $post, $story_data, $args )` +Fires before the content of the small card grid is rendered in the `partials/_latest-updates*.php` partials. 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 shortcode. + +--- + ### `do_action( 'fictioneer_site', $args )` Fires right after opening the `#site` container in the `header.php` template. Includes the navigation bar and site header with background, logo, title, etc. diff --git a/partials/_latest-chapters-compact.php b/partials/_latest-chapters-compact.php index 96f65689..239dc471 100644 --- a/partials/_latest-chapters-compact.php +++ b/partials/_latest-chapters-compact.php @@ -147,6 +147,8 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
+ + > diff --git a/partials/_latest-chapters.php b/partials/_latest-chapters.php index b3c205da..df693bdf 100644 --- a/partials/_latest-chapters.php +++ b/partials/_latest-chapters.php @@ -147,6 +147,8 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
+ + > diff --git a/partials/_latest-recommendations-compact.php b/partials/_latest-recommendations-compact.php index 2a01c5b8..2d56c130 100644 --- a/partials/_latest-recommendations-compact.php +++ b/partials/_latest-recommendations-compact.php @@ -116,6 +116,8 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
+ + > 'no-auto-lightbox'] ); ?> diff --git a/partials/_latest-recommendations.php b/partials/_latest-recommendations.php index 5d506fb8..150aefaf 100644 --- a/partials/_latest-recommendations.php +++ b/partials/_latest-recommendations.php @@ -135,6 +135,8 @@ remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );