Comment.php
3 days ago
Media.php
3 days ago
Post.php
3 days ago
Taxonomy.php
3 days ago
User.php
3 days ago
User.php
33 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 User 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/user_form', '__return_true', 16); |
| 17 | add_filter('acf/location/rule_match/user_role', '__return_true', 16); |
| 18 | |
| 19 | // We need to pass an argument, otherwise the filters won't work |
| 20 | $groups = acf_get_field_groups(['ac_dummy' => true]); |
| 21 | |
| 22 | // Remove all location filters for the next storage_model |
| 23 | remove_filter('acf/location/rule_match/user_type', '__return_true', 16); |
| 24 | remove_filter('acf/location/rule_match/page_type', '__return_true', 16); |
| 25 | |
| 26 | remove_filter('acf/location/rule_match/user_form', '__return_true', 16); |
| 27 | remove_filter('acf/location/rule_match/user_role', '__return_true', 16); |
| 28 | |
| 29 | return $groups; |
| 30 | } |
| 31 | |
| 32 | } |
| 33 |