Question: I have two custom post type **Author** and **Book**. The book cpt have an **ACF Object Field** (*authors\_object\_field*) that is related to authors. On the author single page i want to display all **books** that have the **author** listed in their **ACF Object Field**. I'm using **Elementor** as page builder. I used this code but dont seems to work. Need your lights :)

```
function my_books_by_author_query($query)
{
    $myCurrentAuthorID = get_the_ID();
    $meta_query = [
        [
            'key' => 'authors_object_field',
            'value' => $myCurrentAuthorID,
            'compare' => '==',
        ]
    ];
    $query->set('meta_query', $meta_query);
    $query->set('post_type', 'book');
}
add_action('elementor/query/booksByAuthor', 'my_books_by_author_query');

```

Answer: 
For the benefit of anyone else finding this off the back of a search query, I had the same issue with `fcp_copy_dir()` function not found.

Cause: I'd migrated the site from a Flywheel instance. `fcp_copy_dir()` seems to be a custom Flywheel function they've added to WP core. Core WP runs into errors when run in non-Flywheel environments.

Diagnosis: Use `wp core verify-checksums` to validate the integrity of WP core. In my case, this showed 3 files had been modified.

Resolution: Revert to a clean WP core.
Looks like the Cloudways migration didn't complete properly. Reinstalling WordPress from the dashboard solved it.