From 56b38c4b288d0f4b35ee5129cf43bfa725d14446 Mon Sep 17 00:00:00 2001 From: Ruben Del Blanco Date: Thu, 17 Aug 2023 19:47:32 +0200 Subject: [PATCH] fix:check if $orderby is not an array --- CPT_Columns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CPT_Columns.php b/CPT_Columns.php index 6bc5c0e..8223be9 100644 --- a/CPT_Columns.php +++ b/CPT_Columns.php @@ -318,7 +318,7 @@ function _column_orderby( $query ) { } $orderby = $query->get( 'orderby' ); - if ( (!empty( $orderby ) && isset( $this->cpt_sortable_columns[ $orderby ], $this->cpt_sortable_columns[ $orderby ][ 'type' ] )) && $this->cpt_sortable_columns[ $orderby ][ 'type' ] === 'custom_value' ) { + if ( !is_array( $orderby ) && (!empty( $orderby ) && isset( $this->cpt_sortable_columns[ $orderby ], $this->cpt_sortable_columns[ $orderby ][ 'type' ] )) && $this->cpt_sortable_columns[ $orderby ][ 'type' ] === 'custom_value' ) { $query->set( 'orderby', 'meta_value' ); //$query->set( 'meta_key', $this->cpt_sortable_columns[ $orderby ][ 'meta_key' ] ); $query->set( 'meta_query', array(