Gists

5 years ago
<?php

// props @zaphod-42 <https://wordpress.org/support/topic/not-working-with-facetwp/#post-9168365>
add_filter( 'facetwp_pre_filtered_post_ids', function( $post_ids ) {
    if ( ! empty( $post_ids ) && is_object( $post_ids[0] ) ) {
        $post_ids = wp_list_pluck( $post_ids, 'ID' );
    }
    return $post_ids;
});