protected function maybe_update_post_cache($to_cache) { global $post; if (!isset($post->ID) || empty($to_cache)) { return; } $urls = array_merge($this->get_post_cache(), $to_cache); update_post_meta($post->ID, 'amazonS3_cache', $urls); }