Plugin Directory

Changeset 1718695


Ignore:
Timestamp:
08/24/2017 09:38:24 AM (9 years ago)
Author:
pqina
Message:

fix problem with tables only showing 5 items

Location:
snippy/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • snippy/trunk/includes/db.php

    r1700307 r1718695  
    2727        array_unshift($params, $table);
    2828
    29         $wpdb->query(vsprintf($sql, $params));
     29        return $wpdb->query( vsprintf($sql, $params) );
    3030    }
    3131
     
    115115
    116116    static public function get_total_entries($table) {
    117         return self::run_simple_query('SELECT COUNT(id) FROM %s', $table);
     117        global $wpdb;
     118        $table_name = self::get_table_name($table);
     119        return count($wpdb->get_results( "SELECT id FROM $table_name", ARRAY_A ));
    118120    }
    119121
  • snippy/trunk/includes/list.php

    r1700307 r1718695  
    116116    function prepare_items()
    117117    {
    118         $per_page = 5; // constant, how much records will be shown per page
     118        $per_page = 20;
    119119        $columns = $this->get_columns();
    120120        $hidden = array();
     
    138138        $this->items = Data::get_entries($this->table, $orderby, $order, $per_page, $paged);
    139139
    140         $this->set_pagination_args(array(
     140        $this->set_pagination_args( array(
    141141            'total_items' => $total_items, // total items defined above
    142142            'per_page' => $per_page, // per page constant defined at top of method
  • snippy/trunk/readme.txt

    r1711334 r1718695  
    55Requires at least: 4.5
    66Tested up to: 4.8.1
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    103103== Changelog ==
    104104
     105= 1.1.1 =
     106
     107* Fix problem where shortcode and bits tables would not show paging control
     108
     109
    105110= 1.1.0 =
    106111
     
    116121
    117122== Upgrade Notice ==
     123
     124Fix problem where shortcode and bits tables would not show paging control
  • snippy/trunk/snippy.php

    r1711334 r1718695  
    44* Plugin URI: https://pqina.nl/snippy
    55* Description: Snippy, create your own super flexible shortcodes
    6 * Version: 1.1.0
     6* Version: 1.1.1
    77* Author: PQINA
    88* Author URI: https://pqina.nl
     
    6363
    6464    // Snippy version
    65     public static $version = '1.1.0';
     65    public static $version = '1.1.1';
    6666
    6767    private static $_instance = null;
Note: See TracChangeset for help on using the changeset viewer.