You appear to be a bot. Output may be restricted
Description
Fetch total number of log IDs needing migration
Usage
EDD_File_Download_Log_Migration::pre_fetch();
Parameters
Returns
void
Source
File name: easy-digital-downloads/includes/admin/upgrades/classes/class-file-download-log-migration.php
Lines:
1 to 29 of 29
public function pre_fetch() { global $wpdb; // Default count (assume no entries) $log_id_count = 0; // Query for a term ID (make sure log items exist) $term_id = $wpdb->get_var( "SELECT term_id FROM {$wpdb->terms} WHERE name = 'file_download' LIMIT 1" ); // Log items exist... if ( ! empty( $term_id ) ) { // Query for possible entries... $term_tax_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id = %d AND taxonomy = 'edd_log_type' LIMIT 1", $term_id ) ); // Entries exist... if ( ! empty( $term_tax_id ) ) { // Cache the term taxonomy ID update_option( 'edd_fdlm_term_tax_id', $term_tax_id ); // Count the number of entries! $log_id_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->term_relationships} WHERE term_taxonomy_id = %d", $term_tax_id ) ); } } // Temporarily save the number of rows update_option( 'edd_fdlm_total_logs', (int) $log_id_count ); }