diff --git a/includes/featured-image-generator.php b/includes/featured-image-generator.php index 7c19259..f756c89 100644 --- a/includes/featured-image-generator.php +++ b/includes/featured-image-generator.php @@ -115,12 +115,14 @@ add_action('init', 'add_image_generator_endpoint'); function handle_image_request() { if (!isset($_GET['post'])) return; - - $post_id = $_GET['post']; + + $post_id = absint( $_GET['post'] ); + if ( $post_id <= 0 ) return; + $post = get_post($post_id); // Verify post type - if (!$post && $post->post_type !== 'sp_event') return; + if (!$post || $post->post_type !== 'sp_event') return; // Get associated teams from post meta $team_ids = get_post_meta($post_id, 'sp_team', false); // false to get an array of values diff --git a/includes/open-graph-tags.php b/includes/open-graph-tags.php index e0f88f8..8685a89 100644 --- a/includes/open-graph-tags.php +++ b/includes/open-graph-tags.php @@ -189,10 +189,10 @@ function custom_open_graph_tags_with_sportspress_integration() { $description .= " " . $post->post_content; $image = asc_sp_event_matchup_image_url( $post ); echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; } } }