{"id":37959,"date":"2015-08-04T01:08:40","date_gmt":"2015-08-04T01:08:40","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/acf-to-wp-rest-api\/"},"modified":"2016-01-23T22:00:13","modified_gmt":"2016-01-23T22:00:13","slug":"acf-to-wp-rest-api","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/acf-to-wp-rest-api\/","author":14438650,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.3","stable_tag":"trunk","tested":"4.4.34","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"ACF to WP REST API","header_author":"Aires Gon\u00e7alves","header_description":"","assets_banners_color":"f9f9f9","last_updated":"2016-01-23 22:00:13","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/github.com\/airesvsg\/acf-to-wp-rest-api","header_author_uri":"http:\/\/github.com\/airesvsg","rating":5,"author_block_rating":0,"active_installs":100,"downloads":5745,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"4"},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"1250781","resolution":"128x128","location":"assets"},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"1250781","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":"1250781","resolution":"1544x500","location":"assets"},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1250781","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[2211,1556,2299,2300,2301],"plugin_category":[59],"plugin_contributors":[81174],"plugin_business_model":[],"class_list":["post-37959","plugin","type-plugin","status-closed","hentry","plugin_tags-acf","plugin_tags-api","plugin_tags-rest","plugin_tags-wp-api","plugin_tags-wp-rest-api","plugin_category-utilities-and-tools","plugin_contributors-airesvsg","plugin_committers-airesvsg"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/acf-to-wp-rest-api_f9f9f9.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong>This version was discontinued, please upgrade to V2<\/strong>\nhttps:\/\/wordpress.org\/plugins\/acf-to-rest-api\/<\/p>\n\n<p>Puts in answers all fields of ACF.<\/p>\n\n<p><strong>Fork me on GitHub<\/strong><\/p>\n\n<p>https:\/\/github.com\/airesvsg\/acf-to-wp-rest-api<\/p>\n\n<p><strong>Get ACF data by ID<\/strong><\/p>\n\n<ul>\n<li>\/wp-json\/acf\/post\/ID<\/li>\n<li>\/wp-json\/acf\/page\/ID<\/li>\n<li>\/wp-json\/acf\/user\/ID<\/li>\n<li>\/wp-json\/acf\/term\/ID\/TAXONOMY<\/li>\n<li>\/wp-json\/acf\/comment\/ID<\/li>\n<li>\/wp-json\/acf\/attachment\/ID<\/li>\n<\/ul>\n\n<p><strong>Get Options<\/strong><\/p>\n\n<ul>\n<li>\/wp-json\/acf\/options<\/li>\n<\/ul>\n\n<p><strong>Get Option by Field Name<\/strong><\/p>\n\n<ul>\n<li>\/wp-json\/acf\/options\/FIELD_NAME<\/li>\n<\/ul>\n\n<p><strong>Sample Answer<\/strong><\/p>\n\n<pre><code>{\n  \"ID\" : 1,\n  \"post_title\" : \"Post 1\",\n  \"...\"\n  \"acf\" : {\n    \"field1\" : \"value 1\",\n    \"field2\" : \"value 2\"\n  }\n}\n<\/code><\/pre>\n\n<p><strong>Filter<\/strong><\/p>\n\n<p>Use the filter (<strong>acf_to_wp_rest_api_<code>{type}<\/code>_data<\/strong>) to customize the answer.<\/p>\n\n<p>The wildcard <code>{type}<\/code> can be: <strong>post<\/strong>, <strong>page<\/strong>, <strong>user<\/strong>, <strong>term<\/strong>, <strong>comment<\/strong>, <strong>attachment<\/strong> or <strong>options<\/strong><\/p>\n\n<p><strong><em>How to use<\/em><\/strong><\/p>\n\n<pre><code>add_filter( 'acf_to_wp_rest_api_post_data', function( $data, $object, $context ) {\n    if ( isset( $data['type'] ) &amp;&amp; 'my_post_type' == $data['type'] &amp;&amp; isset( $data['acf'] ) ) {\n      \/\/ do something\n    }\n    return $data;\n}, 10, 3 );\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Copy the <code>acf-to-wp-rest-api<\/code> folder into your <code>wp-content\/plugins<\/code> folder<\/li>\n<li>Activate the <code>ACF to WP REST API<\/code> plugin via the plugins admin page<\/li>\n<\/ol>","raw_excerpt":"Puts ACF data into the WP-REST-API ( WP-API | WordPress JSON API ).\nAlso you can customize the answer using filters.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/37959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=37959"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/airesvsg"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=37959"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=37959"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=37959"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=37959"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=37959"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=37959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}