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
Comment.php
28 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 Comment 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 | add_filter('acf/location/rule_match/comment', '__return_true', 16); |
| 16 | |
| 17 | // We need to pass an argument, otherwise the filters won't work |
| 18 | $groups = acf_get_field_groups(['ac_dummy' => true]); |
| 19 | |
| 20 | remove_filter('acf/location/rule_match/user_type', '__return_true', 16); |
| 21 | remove_filter('acf/location/rule_match/page_type', '__return_true', 16); |
| 22 | remove_filter('acf/location/rule_match/comment', '__return_true', 16); |
| 23 | |
| 24 | return $groups; |
| 25 | } |
| 26 | |
| 27 | } |
| 28 |