widget_media_image(); } /** * Widget Media Image * * @since 1.0.14 * @return void */ public function widget_media_image() { $data = get_option( 'widget_media_image', null ); Astra_Sites_Importer_Log::add( '---- Processing Images from Widgets -----' ); foreach ( $data as $key => $value ) { if ( isset( $value['url'] ) && isset( $value['attachment_id'] ) ) { $image = array( 'url' => $value['url'], 'id' => $value['attachment_id'], ); $downloaded_image = Astra_Sites_Image_Importer::get_instance()->import( $image ); $data[ $key ]['url'] = $downloaded_image['url']; $data[ $key ]['attachment_id'] = $downloaded_image['id']; } } update_option( 'widget_media_image', $data ); } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Sites_Batch_Processing_Widgets::get_instance(); endif;