diff --git a/classes/monthly.php b/classes/monthly.php index d6d63e3..ded363f 100644 --- a/classes/monthly.php +++ b/classes/monthly.php @@ -19,13 +19,13 @@ function load_values( $params ) { // Orderby $orderby = 'f.facet_display_value DESC'; - if ( 'asc' === $facet['orderby'] ) { + if ( ! empty( $facet['orderby'] ) && 'asc' === $facet['orderby'] ) { $orderby = 'f.facet_display_value ASC'; } // Limit $limit = 10; - if ( absint( $facet['count'] ) > 0 ) { + if ( ! empty( $facet['count'] ) && absint( $facet['count'] ) > 0 ) { $limit = absint( $facet['count'] ); } @@ -95,7 +95,7 @@ function filter_posts( $params ) { $dates = explode( '-', reset( $selected_values ) ); if ( count( $dates ) < 2 ) { - $dates = array( date( 'Y' ), date( 'm' ) ); + $dates = array( date( 'Y' ), date( 'm' ) ); } $sql = $wpdb->prepare( "SELECT DISTINCT post_id @@ -118,95 +118,95 @@ function filter_posts( $params ) { * Output admin settings HTML */ function settings_html() { ?> -