Home › Forums › Backend Issues (wp-admin) › How to get all ACF groups or field for specific post type › Reply To: How to get all ACF groups or field for specific post type
This code is not working, I’ve tried it and it’s returning an empty array. I’ve trace the code and found out that the filter code always returns false when using outside of ACF.
Function
$groups = acf_get_field_groups(array('post_type' => 'your-post-type'));
Filter code
function acf_match_location_rule( $rule, $screen ) {
// vars
$result = false;
// filter
$result = apply_filters( "acf/location/rule_match/{$rule['param']}", $result, $rule, $screen );
$result = apply_filters( "acf/location/rule_match", $result, $rule, $screen );
// return
return $result;
}
Hope someone can help further explore find a solution for this 🙂
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.