This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
To download all collection images. | |
1) Create a blank page template and add the code below. | |
2) Create a blank hidden page that uses this new template. | |
3) If using Chrome, use an extension that can download all images from a page, such as: | |
https://chrome.google.com/webstore/detail/image-downloader-imageye/agionbommeaifngbhincahgmoflcikhm | |
(Disclaimer: I am not associated in any manner with this extension or its developers. I am sharing this only because it worked for me) | |
4) Open the preview of your hidden page and you should see all collections images view on the page. | |
5) Open the extension you've installed and you can then download all collection images. | |
{% endcomment %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_ACF_meta_in_REST() { | |
$postypes_to_exclude = ['acf-field-group','acf-field']; | |
$extra_postypes_to_include = ["page"]; | |
$post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exclude); | |
array_push($post_types, $extra_postypes_to_include); | |
foreach ($post_types as $post_type) { | |
register_rest_field( $post_type, 'ACF', [ |