Last active
March 3, 2016 19:17
-
-
Save woodwardtw/cf706545a064a02fbd60 to your computer and use it in GitHub Desktop.
wordpress multisite query to get the 50 blogs that have gone the longest without being updated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$results = $wpdb->get_results( 'SELECT * FROM wp_blogs ORDER BY last_updated ASC LIMIT 50', ARRAY_A);//change how many you want back here | |
//var_dump($results); | |
echo '<table>'; | |
foreach ( $results as $site ) | |
{ | |
echo '<tr><td>' . | |
get_blog_option( $site['blog_id'], "blogname") . | |
'</td><td> ' . $site['last_updated'] . | |
'</td><td><A HREF="' . get_blog_option( $site['blog_id'], "siteurl") . | |
'">LINK</A></td><td><a href="mailto:'.get_blog_option( $site['blog_id'], "admin_email") . | |
'?Subject=doom" target="_top">email '. get_blog_option( $site['blog_id'], "admin_email") . | |
'</a></td></tr>'; | |
} | |
echo '</table>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment