Comment.php
2 days ago
Media.php
2 days ago
Post.php
2 days ago
Taxonomy.php
2 days ago
User.php
2 days ago
Taxonomy.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Acf\FieldGroup\Location; |
| 6 | |
| 7 | use AC\Acf\FieldGroup\Query; |
| 8 | |
| 9 | class Taxonomy implements Query |
| 10 | { |
| 11 | public function get_groups(): array |
| 12 | { |
| 13 | add_filter('acf/location/rule_match/user_type', '__return_true', 16); |
| 14 | add_filter('acf/location/rule_match/page_type', '__return_true', 16); |
| 15 | |
| 16 | add_filter('acf/location/rule_match/taxonomy', '__return_true', 16); |
| 17 | |
| 18 | // We need to pass an argument, otherwise the filters won't work |
| 19 | $groups = acf_get_field_groups(['ac_dummy' => true]); |
| 20 | |
| 21 | remove_filter('acf/location/rule_match/user_type', '__return_true', 16); |
| 22 | remove_filter('acf/location/rule_match/page_type', '__return_true', 16); |
| 23 | |
| 24 | remove_filter('acf/location/rule_match/taxonomy', '__return_true', 16); |
| 25 | |
| 26 | return $groups; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |