From 4a6e5914bf9b4d4098678833d0761e935571f209 Mon Sep 17 00:00:00 2001
From: Tetrakern <26898880+Tetrakern@users.noreply.github.com>
Date: Mon, 15 Apr 2024 12:02:28 +0200
Subject: [PATCH] Replace _share-buttons-php partial
---
includes/functions/_setup-shortcodes.php | 30 +++-----
includes/functions/hooks/_chapter_hooks.php | 3 +-
includes/functions/hooks/_post_hooks.php | 4 +-
includes/functions/hooks/_story_hooks.php | 2 +-
partials/_share-buttons.php | 81 ---------------------
5 files changed, 14 insertions(+), 106 deletions(-)
delete mode 100644 partials/_share-buttons.php
diff --git a/includes/functions/_setup-shortcodes.php b/includes/functions/_setup-shortcodes.php
index 3100dcdc..54a438e4 100644
--- a/includes/functions/_setup-shortcodes.php
+++ b/includes/functions/_setup-shortcodes.php
@@ -1646,11 +1646,8 @@ add_shortcode( 'fictioneer_story_section', 'fictioneer_shortcode_story_section'
*/
function fictioneer_shortcode_story_actions( $attr ) {
- global $post;
-
// Setup
$story_id = absint( $attr['story_id'] ?? 0 );
- $post = get_post( $story_id );
$story_data = fictioneer_get_story_data( $story_id );
$classes = wp_strip_all_tags( $attr['class'] ?? '' );
$follow = filter_var( $attr['follow'] ?? 1, FILTER_VALIDATE_BOOLEAN );
@@ -1661,6 +1658,8 @@ function fictioneer_shortcode_story_actions( $attr ) {
$share = filter_var( $attr['share'] ?? 1, FILTER_VALIDATE_BOOLEAN );
$hook_args = array(
+ 'post_id' => $story_id,
+ 'post_type' => 'fcn_story',
'story_id' => $story_id,
'story_data' => $story_data,
'follow' => $follow,
@@ -1698,34 +1697,23 @@ function fictioneer_shortcode_story_actions( $attr ) {
// Add filter for buttons
add_filter( 'fictioneer_filter_story_buttons', 'fictioneer_shortcode_remove_story_buttons', 99, 2 );
- // Buffer
- ob_start();
-
- // Setup post data
- setup_postdata( $post );
-
- // Start HTML ---> ?>
-