Plugin Directory

Changeset 1303375

Timestamp:
12/08/2015 11:13:34 PM (9 years ago)
Author:
nickmomrik
Message:

Add number format. Limit to the post post_type. Bump version to 2.0.

Location:
post-count
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • post-count/trunk/post-count.php

    r155540 r1303375  
    22/*
    33Plugin Name: Post Count
    4 Plugin URI: http://wordpress.org/extend/plugins/post-count/
     4Plugin URI: http/plugins/post-count/
    55Description: Outputs the total number of posts.
    6 Version: 1.1
     6Version:
    77Author: Nick Momrik
    88Author URI: http://nickmomrik.com/
     
    1111function mdv_post_count() {
    1212    global $wpdb;
    13     echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '" . gmdate("Y-m-d H:i:s",time()) . "'");
     13
     14    $now = gmdate( 'Y-m-d H:i:s', time() );
     15    echo number_format( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND post_date_gmt < %s", $now ) ) );
    1416}
    15 ?>
  • post-count/trunk/readme.txt

    r248712 r1303375  
    22Contributors: nickmomrik
    33Tags: posts, count
    4 Stable tag: trunk
     4Stable tag: 2.0
     5Tested up to: 4.4
    56
    67Counts the number of posts.
Note: See TracChangeset for help on using the changeset viewer.