{$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 = 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; } if ( $url = $this->as3cf->get_attachment_local_url( $attachment['attachment_id'] ) ) { $attachments[ $key ]['file'] = $url; } } update_post_meta( $item->post_id, 'edd_download_files', $attachments ); return true; } }