{"action":"created","issue":{"url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/47","repository_url":"https://api.github.com/repos/unfulvio/wp-api-menus","labels_url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/47/comments","events_url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/47/events","html_url":"https://github.com/unfulvio/wp-api-menus/issues/47","id":254005697,"number":47,"title":"Support for custom metas/ACF fields","user":{"login":"lewisdonovan","id":23400003,"avatar_url":"https://avatars0.githubusercontent.com/u/23400003?v=4","gravatar_id":"","url":"https://api.github.com/users/lewisdonovan","html_url":"https://github.com/lewisdonovan","followers_url":"https://api.github.com/users/lewisdonovan/followers","following_url":"https://api.github.com/users/lewisdonovan/following{/other_user}","gists_url":"https://api.github.com/users/lewisdonovan/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisdonovan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisdonovan/subscriptions","organizations_url":"https://api.github.com/users/lewisdonovan/orgs","repos_url":"https://api.github.com/users/lewisdonovan/repos","events_url":"https://api.github.com/users/lewisdonovan/events{/privacy}","received_events_url":"https://api.github.com/users/lewisdonovan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-30T13:48:44Z","updated_at":"2017-08-30T14:56:19Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nGreat plugin! Just wondering if there's any way I could add in support for displaying custom metas attached to a menu? Since 5.6.0, Advanced Custom Fields has added support for adding custom fields to menus, would be great to be able to pull this into the API.\r\n\r\nIf you're looking for contributors I'm happy to get involved on this. Cheers"},"comment":{"url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/comments/326017032","html_url":"https://github.com/unfulvio/wp-api-menus/issues/47#issuecomment-326017032","issue_url":"https://api.github.com/repos/unfulvio/wp-api-menus/issues/47","id":326017032,"user":{"login":"lewisdonovan","id":23400003,"avatar_url":"https://avatars0.githubusercontent.com/u/23400003?v=4","gravatar_id":"","url":"https://api.github.com/users/lewisdonovan","html_url":"https://github.com/lewisdonovan","followers_url":"https://api.github.com/users/lewisdonovan/followers","following_url":"https://api.github.com/users/lewisdonovan/following{/other_user}","gists_url":"https://api.github.com/users/lewisdonovan/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisdonovan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisdonovan/subscriptions","organizations_url":"https://api.github.com/users/lewisdonovan/orgs","repos_url":"https://api.github.com/users/lewisdonovan/repos","events_url":"https://api.github.com/users/lewisdonovan/events{/privacy}","received_events_url":"https://api.github.com/users/lewisdonovan/received_events","type":"User","site_admin":false},"created_at":"2017-08-30T14:56:19Z","updated_at":"2017-08-30T14:56:19Z","author_association":"NONE","body":"Anyone using the v2 API and looking for a quick fix for ACF fields, you'll need to add the following edits to includes/wp-api-menus-v2.php\r\n\r\nFrom line 159:\r\n```\r\n//get ACF fields\r\n$fields = get_fields('term_'.$menu['term_id']);\r\n//If we have fields...\r\nif ($fields){\r\n    //Loop through them...\r\n    foreach ($fields as $field_name => $value){\r\n        //Set the meta\r\n        $rest_menu[$field_name] = $value;\r\n    }\r\n}\r\n```\r\n\r\nFrom line 116:\r\n```\r\n//get ACFfields\r\n$fields = get_fields('term_'.$menu['term_id']);\r\n//If we have fields...\r\nif ($fields){\r\n    //Loop through them...\r\n    foreach ($fields as $field_name => $value){\r\n        //Set the meta\r\n        $rest_menus[ $i ][$field_name] = $value;\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"lewisdonovan"}}