From 945a29fba26f964cc85480f9774badb72bf7c72c Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 14 Jan 2017 20:43:32 +1100 Subject: [PATCH] Fix manual player performance errors --- includes/class-sp-player.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index f3967bd8..4868919e 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -143,7 +143,7 @@ class SP_Player extends SP_Custom_Post { $posts = get_posts( $args ); if ( $manual_columns ) { - $usecolumns = get_post_meta( $this->ID, 'sp_columns', true ); + $usecolumns = (array)get_post_meta( $this->ID, 'sp_columns', true ); $has_checkboxes = true; } else { $usecolumns = array(); @@ -196,7 +196,8 @@ class SP_Player extends SP_Custom_Post { $posts = get_posts( $args ); if ( $manual_columns ) { - $usecolumns += get_post_meta( $this->ID, 'sp_columns', true ); + $usecolumns = array_merge( $usecolumns, (array) get_post_meta( $this->ID, 'sp_columns', true ) ); + $usecolumns = array_filter( $usecolumns ); } else { if ( is_array( $posts ) ) { foreach ( $posts as $post ) {