Support

Account

Home Forums ACF PRO Continuous loop in Relationship field with custom title + custom search Reply To: Continuous loop in Relationship field with custom title + custom search

  • Sorry, I didn’t see the second hook, I was thinking it was something simple. Honestly, I can tell what the functions search_custom_meta_acf_add_join and search_custom_meta_acf_alter_search are doing and if it’s doing it correctly or incorrectly, obviously there’s something wrong there.

    What does the actual query that being run look like? That would probably give you some clue about what’s actually happening, as well what the actual results being returned are.

    Since this is happening during AJAX you’ll need to be creative to see what’s actually going on.

    
    // add this to wp-config.php
    // to log errors
    define('WP_DEBUG', true );
    define('WP_DEBUG_DISPLAY', false);
    define('WP_DEBUG_LOG', true);
    
    
    // add this action to
    // log complete query to error log
    add_action('posts_selection', 'log_the_query');
    function log_the_query($query) {
      error_log($query);
    }
    

    Then you can look at the query that’s being done an see if there’s anything in it that could cause the problem.