diff --git a/includes/classes/Feature/SearchOrdering/SearchOrdering.php b/includes/classes/Feature/SearchOrdering/SearchOrdering.php index 78ed5ce75b..7882bd7583 100644 --- a/includes/classes/Feature/SearchOrdering/SearchOrdering.php +++ b/includes/classes/Feature/SearchOrdering/SearchOrdering.php @@ -655,7 +655,7 @@ public function posts_results( $posts, $query ) { if ( isset( $post->terms ) && isset( $post->terms[ self::TAXONOMY_NAME ] ) ) { foreach ( $post->terms[ self::TAXONOMY_NAME ] as $current_term ) { if ( strtolower( $current_term['name'] ) === $search_query ) { - $to_inject[ $current_term['term_order'] ] = $post->ID; + $to_inject[ $current_term['term_order'] ] = $post; unset( $posts[ $key ] ); @@ -673,7 +673,7 @@ public function posts_results( $posts, $query ) { if ( ! empty( $to_inject ) ) { foreach ( $to_inject as $position => $newpost ) { - array_splice( $posts, $position - 1, 0, $newpost ); + array_splice( $posts, $position - 1, 0, array( $newpost ) ); } }