Home › Forums › Backend Issues (wp-admin) › How can I send an additional field during ajax requests? › Reply To: How can I send an additional field during ajax requests?
Do you have to show the parent posts in the field? If not then I would filter the query using acf/fields/post_object/query by adding
$args['post_parent__in'] = array(0);
If you must show the parents and have them disabled in the field, Unfortunately, there are no hooks that will let you filter the json response from the server. In this case what you would have to do is do a query to get a list of post IDs that have parent = 0 and output those as a JS variable so that you can compare the values returned from the request to determine disabled or not.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!