{"action":"opened","issue":{"url":"https://api.github.com/repos/StoutLogic/acf-builder/issues/39","repository_url":"https://api.github.com/repos/StoutLogic/acf-builder","labels_url":"https://api.github.com/repos/StoutLogic/acf-builder/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/StoutLogic/acf-builder/issues/39/comments","events_url":"https://api.github.com/repos/StoutLogic/acf-builder/issues/39/events","html_url":"https://github.com/StoutLogic/acf-builder/issues/39","id":231750975,"number":39,"title":"setLocation happening late?","user":{"login":"Log1x","id":5745907,"avatar_url":"https://avatars0.githubusercontent.com/u/5745907?v=3","gravatar_id":"","url":"https://api.github.com/users/Log1x","html_url":"https://github.com/Log1x","followers_url":"https://api.github.com/users/Log1x/followers","following_url":"https://api.github.com/users/Log1x/following{/other_user}","gists_url":"https://api.github.com/users/Log1x/gists{/gist_id}","starred_url":"https://api.github.com/users/Log1x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Log1x/subscriptions","organizations_url":"https://api.github.com/users/Log1x/orgs","repos_url":"https://api.github.com/users/Log1x/repos","events_url":"https://api.github.com/users/Log1x/events{/privacy}","received_events_url":"https://api.github.com/users/Log1x/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-26T22:49:05Z","updated_at":"2017-05-26T22:49:05Z","closed_at":null,"body":"Hi.\r\n\r\nFirst of all, thank you very much for acf-builder. It's absolutely amazing and made my life much more sane.\r\n\r\nI'm not sure if you've heard of the plugin [WP Papi](https://wp-papi.github.io/) -- but I wrote a set of filters so I could use \"Papi Page Types\" inside of ACF.\r\n\r\nFor some reason my filters work perfectly in ACF's Field Builder but when I try to use it with acf-builder it doesn't work.\r\n\r\n`setLocation('papi_page_type', '==', 'home')`\r\n\r\nHere are my filters:\r\n\r\n```\r\nadd_filter('acf/location/rule_types', function ($choices) {\r\n    $choices['Papi']['papi_page_type'] = 'Page Type';\r\n    return $choices;\r\n});\r\n\r\n```\r\n```\r\nadd_filter('acf/location/rule_values/papi_page_type', function ($choices) {\r\n    $page_types = papi_get_all_page_types();\r\n\r\n    if ($page_types) {\r\n        $page_types = array_map(function($page_type) {\r\n            return [\r\n                'id'   => $page_type->get_id(),\r\n                'name' => $page_type->name\r\n            ];\r\n        }, $page_types);\r\n\r\n        foreach ($page_types as $page_type) {\r\n            $choices[$page_type['id']] = $page_type['name'];\r\n        }\r\n    }\r\n\r\n    return $choices;\r\n});\r\n\r\n```\r\n```\r\nadd_filter('acf/location/rule_match/papi_page_type', function ($match, $rule, $options) {\r\n    if (!$options['post_id']) {\r\n        return false;\r\n    }\r\n\r\n    $page_type = papi_get_page_type_id($options['post_id']);\r\n    $selected_type = $rule['value'];\r\n\r\n    if ($rule['operator'] == '==') {\r\n        $match = ($page_type == $selected_type);\r\n    }\r\n\r\n    if ($rule['operator'] == '!=') {\r\n        $match = ($page_type != $selected_type);\r\n    }\r\n\r\n    return $match;\r\n}, 10, 3);\r\n\r\n```\r\nSince it works when creating the fields in ACF's builder, I'm not really sure why it wouldn't be working with acf-builder.\r\n\r\nAny help with this would be appreciated."}}
{"actor":{"display_login":"Log1x"}}