FacetWP + ACF Post2Post – re-index bidirectional posts

<?php

add_action( 'acf/post2post/relationship_updated', function( $post_id ) {
    if ( function_exists( 'FWP' ) ) {
        FWP()->indexer->index( $post_id );
    }
});