image_get_intermediate_size always returns false

Whenever media is uploaded, the media gets run through wp_generate_attachment_metadata(). The image_get_intermediate_size() function relies on wp_get_attachment_metadata() to ensure it has some kind of size data to work with. If the image metadata is modified by either customizations or plugins and is missing the thumbnail image size, image_get_intermediate_size() will return false for that image size as … Read more

wp_schedule_event with dynamic names but same function

This is what the 4th parameter, $args is for. Use a single name for the event and pass the unique name as an argument. public function schedule($interval, $event): void { $args = array($event); if (! \wp_next_scheduled(‘my_scheduled_event’, $args)) { \wp_schedule_event(time(), $interval, ‘my_scheduled_event’, $args); } } Then you can have a single callback function that has access … Read more