Skip to content

Instantly share code, notes, and snippets.

@simonkberg
Created July 1, 2013 23:15
Show Gist options
  • Save simonkberg/5905474 to your computer and use it in GitHub Desktop.
Save simonkberg/5905474 to your computer and use it in GitHub Desktop.
Fix for missing wp_users-table error in wp-cron
Index: inc/class-tracking.php
===================================================================
--- inc/class-tracking.php (revision 734869)
+++ inc/class-tracking.php (working copy)
@@ -110,7 +110,7 @@
'name' => get_bloginfo( 'name' ),
'version' => get_bloginfo( 'version' ),
'multisite' => is_multisite(),
- 'users' => $wpdb->get_var( "SELECT COUNT(*) FROM wp_users INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id) WHERE 1 = 1 AND ( wp_usermeta.meta_key = 'wp_{$blog_id}_capabilities' ) " ),
+ 'users' => $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users AS u INNER JOIN $wpdb->usermeta AS m ON (u.ID = m.user_id) WHERE 1 = 1 AND ( m.meta_key = 'wp_{$blog_id}_capabilities' ) " ),
'lang' => get_locale(),
),
'pts' => $pts,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment