mcguffin/acf-dropzone

Drag and drop file upload for ACF-Fields.

Installs: 8 907

Dependents: 0

Suggesters: 0

Security: 0

Stars: 31

Watchers: 3

Forks: 1

Open Issues: 4

Type:wordpress-plugin

1.1.14 2023-10-31 13:28 UTC

README

This is the official github repository of the ACF Dropzone plugin.

About

Add drag and drop upload to ACF File Field, Image field and Gallery field.

Requires at least WP 5.0 and ACF 5.6.

Usage

Enable the "Dropzone" option in the field settings.

Dropzone Setting

Enjoy your new dropping experience!

Happy Dropping

Installation

Production

In WP Admin

Just follow the Automatic Plugin Installation procedere.

WP-CLI

$ wp plugin install --activate acf-dropzone

Using composer

composer require mcguffin/acf-dropzone

Development

  • cd into your plugin directory
  • $ git clone git@github.com:mcguffin/acf-dropzone.git
  • $ cd acf-dropzone
  • $ npm install
  • $ npm run dev

Plugin API

To add dropzone capability to arbitrary field types you can use the acf_dropzone/file_fields and acf_dropzone/gallery_fields filter.

This might come in handy if you use the feature image field type of ACF Frontend, or something alike.

Adding support for ACF Frontend‘s featured_image field:

add_filter( 'acf_dropzone/file_fields', function($fields) {
	$fields[] = 'featured_image';
	return $fields;
});

Please note that the field input HTML needs to be exactly as the one provided by ACF, so filters won't work on any field.