mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Allow draft pages. Use post_type for object types. Reserve post_status strictly for status. fixes #1820
git-svn-id: https://develop.svn.wordpress.org/trunk@3510 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -60,7 +60,7 @@ foreach ($comments as $comment) {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) :
|
||||
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) :
|
||||
?>
|
||||
<div>
|
||||
<h3><?php _e('Posts'); ?> <a href="edit.php" title="<?php _e('More posts...'); ?>">»</a></h3>
|
||||
@@ -79,7 +79,7 @@ foreach ($recentposts as $post) {
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( $scheduled = $wpdb->get_results("SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt > '$today' ORDER BY post_date ASC") ) :
|
||||
if ( $scheduled = $wpdb->get_results("SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND post_date_gmt > '$today' ORDER BY post_date ASC") ) :
|
||||
?>
|
||||
<div>
|
||||
<h3><?php _e('Scheduled Entries:') ?></h3>
|
||||
@@ -98,7 +98,7 @@ foreach ($scheduled as $post) {
|
||||
<div>
|
||||
<h3><?php _e('Blog Stats'); ?></h3>
|
||||
<?php
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
|
||||
if (0 < $numposts) $numposts = number_format($numposts);
|
||||
|
||||
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
|
||||
|
||||
Reference in New Issue
Block a user