Give_API_Keys_Table::total_items PHP Method

total_items() public method

Retrieve count of total users with keys
Since: 1.1
public total_items ( ) : integer
return integer
    public function total_items()
    {
        global $wpdb;
        if (!get_transient('give_total_api_keys')) {
            $total_items = $wpdb->get_var("SELECT count(user_id) FROM {$wpdb->usermeta} WHERE meta_value='give_user_secret_key'");
            set_transient('give_total_api_keys', $total_items, 60 * 60);
        }
        return get_transient('give_total_api_keys');
    }