Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions classes/models/FrmDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ public static function generate_cache_key( $where, $args, $field, $type ) {
* @return array
*/
public static function get_col( $table, $where = array(), $field = 'id', $args = array(), $limit = '' ) {
$columns = self::get_var( $table, $where, $field, $args, $limit, 'col' );
return is_array( $columns ) ? $columns : array();
return self::get_var( $table, $where, $field, $args, $limit, 'col' );
}

/**
Expand Down Expand Up @@ -288,8 +287,7 @@ public static function get_row( $table, $where = array(), $fields = '*', $args =
* @return array
*/
public static function get_results( $table, $where = array(), $fields = '*', $args = array() ) {
$results = self::get_var( $table, $where, $fields, $args, '', 'results' );
return is_array( $results ) ? $results : array();
return self::get_var( $table, $where, $fields, $args, '', 'results' );
}

/**
Expand Down Expand Up @@ -660,6 +658,9 @@ public static function check_cache( $cache_key, $group = '', $query = '', $type
$found = null;
$results = wp_cache_get( $cache_key, $group, false, $found );
if ( $found !== false || empty( $query ) ) {
if ( ! is_array( $results ) && in_array( $type, array( 'get_col', 'get_results' ), true ) ) {
return array();
}
return $results;
}

Expand Down