WordPress plugin for zipping ACF Gallery field contents.
This plugin assumes that you have ACF installed.
Download the zip and install the plugin. Use the hooks to define the post type and field you want to zip.
The plugin creates a REST endpoint for downloading zip files from the given post. You can get the ACF gallery field contents as zip by accessing that url:
<your-website-url>/wp-json/acf-gallery-zipper/v1/zip/<post-id>
The plugin provides a simple API for interacting with the plugin via WordPress hooks.
Use this filter to change the default post type. Default: post
.
Example:
add_filter( 'acf_gallery_zipper_post_type', 'acf_gallery_zipper_change_default_post_type' );
function acf_gallery_zipper_change_default_post_type( $post_type ) {
return 'my-new-post-type';
}
Use this filter to change the default field name that the plugin uses for zipping. Default: gallery
.
Example:
add_filter( 'acf_gallery_zipper_field_name', 'acf_gallery_zipper_change_default_field_name' );
function acf_gallery_zipper_change_default_field_name( $field_name ) {
return 'my_gallery_field_name';
}
Use this filter to change the zip filename. Default: <post slug>
.
Example:
add_filter( 'acf_gallery_zipper_filename', 'acf_gallery_zipper_change_default_filename' );
function acf_gallery_zipper_change_default_filename( $filename ) {
return $filename . '-suffix'; // .zip will be added automatically.
}
Use this filter to change the cache usage. By default the zip files are not stored anywhere but deleted right after they are sent to the user. Default: false
.
Example:
add_filter( 'acf_gallery_zipper_use_cache', 'acf_gallery_zipper_change_default_use_cache' );
function acf_gallery_zipper_change_default_use_cache( $use_cache ) {
return true;
}
Use this filter to change the cache removal recurrence. Default: daily
. Possible values: hourly
, twicedaily
and daily
.
Example:
add_filter( 'acf_gallery_zipper_removal_recurrence', 'acf_gallery_zipper_removal_change_default_recurrence' );
function acf_gallery_zipper_removal_recurrence( $recurrence ) {
return 'hourly';
}
We are open for suggestions so open an issue if you have any feature requests or bug reports. Please do not create a pull request without creating related issue first.