'acf-form',
'new_post' => false,
'field_groups' => [ 'group_acf_dropzone_some' ],
'uploader' => 'wp',
]);
return $content . ob_get_clean();
});
}
/**
* @action 'acf/init'
*/
public function register_blocks() {
if ( ! function_exists('acf_register_block') ) {
return;
}
// register a testimonial block
acf_register_block(array(
'name' => '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();