Plugin Directory

Changeset 1058924


Ignore:
Timestamp:
01/03/2015 08:59:59 AM (11 years ago)
Author:
karevn
Message:

Performance fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • usernoise/trunk/inc/model.php

    r1052708 r1058924  
    142142    }
    143143
    144     public function get_pending_feedback_count($args = array()){
    145         return count($this->get_pending_feedback($args));
     144    public function get_pending_feedback_count(){
     145        global $wpdb;
     146        $count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = %s AND post_status = 'pending'", FEEDBACK));
     147        if (!$count)
     148            $count = 0;
     149        return $count;
    146150    }
    147151
Note: See TracChangeset for help on using the changeset viewer.