{$offset->meta_id}"; } if ( $limit && $limit > 0 ) { $sql .= sprintf( ' LIMIT %d', (int) $limit ); } return $wpdb->get_results( $sql ); } /** * Upgrade item. * * @param mixed $item * * @return bool */ protected function upgrade_item( $item ) { $attachments = AS3CF_Utils::maybe_unserialize( $item->meta_value ); if ( ! is_array( $attachments ) || empty( $attachments ) ) { // No attachments to process, return return false; } foreach ( $attachments as $key => $attachment ) { if ( ! isset( $attachment['attachment_id'] ) || ! isset( $attachment['file'] ) ) { // Can't determine ID or file, continue continue; } $as3cf_item = Media_Library_Item::get_by_source_id( $attachment['attachment_id'] ); if ( empty( $as3cf_item ) ) { continue; } if ( $url = $as3cf_item->get_local_url() ) { $attachments[ $key ]['file'] = $url; } } update_post_meta( $item->post_id, 'edd_download_files', $attachments ); return true; } }