• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_File_Download_Log_Migration::pre_fetch() – Fetch total number of log IDs needing migration

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 );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: EDD_File_Download_Log_Migration::pre_fetch
Class ref: EDD_File_Download_Log_Migration
Plugin ref: Easy Digital Downloads
Version: 2.9.26
Sourcefile: includes/admin/upgrades/classes/class-file-download-log-migration.php
File ref: includes/admin/upgrades/classes/class-file-download-log-migration.php
Deprecated?: No
API Letters: D,E,F,L,M

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites