Home › Forums › ACF PRO › Access to relationship picker in admin › Reply To: Access to relationship picker in admin
Yes, I can give you some direction, but I can’t give you details on your exact case. Honestly, there’s not a lot of information available on doing what you want to do. I have been working on a project that does similar things.
You can see an example of what I’m doing here: https://github.com/Hube2/blunt-parametric-search/blob/master/admin/js/admin.js
This script extends the acf.ajax script. In it I have created change events that fire when certain fields have been changes. Two of the functions do AJAX requests to to get information that’s used to populate other fields. The functions are _para_tax_change and _para_meta_key_change.
Getting values from every type of field is slightly different, I have not worked with a relationship field, which is why a said I can’t give specifics. What I do is just start adding alert(something);
in the script to see what I can figure out and go from there.
You can see the PHP side of the AJAX requests in this file https://github.com/Hube2/blunt-parametric-search/blob/master/admin/php/acf-load.php. You can see where the filters are added in the __construct function and the related functions that are called.
This file contains an example of how I enqueue the script https://github.com/Hube2/blunt-parametric-search/blob/master/admin/php/admin-post-types.php
I realize that’s a long way from an perfect answer but I hope it helps.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.