'acf-dropzone-test',
'title' => __('Dropzone Test'),
'description' => __('Testing ACF-Dropzone'),
'render_callback' => function ( $block, $content, $is_preview, $post_id ) {
printf('
',$block['align']);
echo '
Testing ACF Dropzone
';
echo '';
?>
'embed',
'icon' => 'location-alt',
'mode' => 'preview', // auto|preview|edit
'align' => 'full',
'keywords' => array( 'map' ),
));
}
/**
* @filter 'acf/settings/save_json'
*/
public function load_json( $paths ) {
$paths[] = dirname(__FILE__).'/acf-json';
return $paths;
}
/**
* @filter 'acf/settings/save_json'
*/
public function save_json( $path ) {
if ( ! is_null( $this->current_json_save_path ) ) {
return $this->current_json_save_path;
}
return $path;
}
/**
* Figure out where to save ACF JSON
*
* @action 'acf/update_field_group'
*/
public function mutate_field_group( $field_group ) {
// default
if ( strpos( $field_group['key'], 'group_acf_dropzone_' ) === false ) {
$this->current_json_save_path = null;
return;
}
$this->current_json_save_path = dirname(__FILE__).'/acf-json';
}
}
new PluginTest();