( array_filter( $preparedUrls ) ); } /** * Stores the image data for a given post in our DB table. * * @since 4.0.5 * * @param int $postId The post ID. * @param array $images The images. * @return void */ private function updatePost( $postId, $images = [] ) { $post = \AIOSEO\Plugin\Common\Models\Post::getPost( $postId ); $meta = $post->exists() ? [] : aioseo()->migration->meta->getMigratedPostMeta( $postId ); $meta['post_id'] = $postId; $meta['images'] = ! empty( $images ) ? $images : null; $meta['image_scan_date'] = gmdate( 'Y-m-d H:i:s' ); $post->set( $meta ); $post->save(); } /** * Returns the image extension regex pattern. * * @since 4.2.2 * * @return string */ public function getImageExtensionRegexPattern() { static $pattern; if ( null !== $pattern ) { return $pattern; } $pattern = '/http.*\.(' . implode( '|', $this->supportedExtensions ) . ')$/i'; return $pattern; } }