Compare commits
2 Commits
5361b0da90
...
open-graph
| Author | SHA1 | Date | |
|---|---|---|---|
| a9a6ab3207 | |||
|
8c0b1e3c19
|
@@ -6,8 +6,6 @@ Version: 1.0
|
||||
Author: Your Name
|
||||
*/
|
||||
|
||||
add_action('save_post_sp_event', 'generate_event_featured_image', 10, 3);
|
||||
|
||||
function generate_bisected_image($color1, $color2, $logo1_path, $logo2_path) {
|
||||
$width = 1200;
|
||||
$height = 628;
|
||||
@@ -184,6 +182,17 @@ add_action('template_redirect', 'handle_image_request');
|
||||
|
||||
function serve_image($image_path) {
|
||||
header('Content-Type: image/png');
|
||||
if (file_exists($image_path)) {
|
||||
status_header( 200 );
|
||||
} else {
|
||||
status_header( 404 );
|
||||
die("Image not found.");
|
||||
}
|
||||
|
||||
// Clear all output buffering to prevent any extra output
|
||||
while (ob_get_level()) {
|
||||
ob_end_clean();
|
||||
}
|
||||
readfile($image_path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user