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
Media.php
40 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 Media 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/post', '__return_true', 16); |
| 17 | add_filter('acf/location/rule_match/post_category', '__return_true', 16); |
| 18 | add_filter('acf/location/rule_match/post_status', '__return_true', 16); |
| 19 | add_filter('acf/location/rule_match/post_taxonomy', '__return_true', 16); |
| 20 | |
| 21 | add_filter('acf/location/rule_match/attachment', '__return_true', 16); |
| 22 | |
| 23 | // We need to pass an argument, otherwise the filters won't work |
| 24 | $groups = acf_get_field_groups(['ac_dummy' => true]); |
| 25 | |
| 26 | remove_filter('acf/location/rule_match/user_type', '__return_true', 16); |
| 27 | remove_filter('acf/location/rule_match/page_type', '__return_true', 16); |
| 28 | |
| 29 | remove_filter('acf/location/rule_match/post', '__return_true', 16); |
| 30 | remove_filter('acf/location/rule_match/post_category', '__return_true', 16); |
| 31 | remove_filter('acf/location/rule_match/post_status', '__return_true', 16); |
| 32 | remove_filter('acf/location/rule_match/post_taxonomy', '__return_true', 16); |
| 33 | |
| 34 | remove_filter('acf/location/rule_match/attachment', '__return_true', 16); |
| 35 | |
| 36 | return $groups; |
| 37 | } |
| 38 | |
| 39 | } |
| 40 |