templates_manager->get_import_images_instance()->import( $attachment );
}
// Filter out attachments that don't exist
$settings = array_filter( $settings );
return $settings;
}
/**
* Render gallery control output in the editor.
*
* Used to generate the control HTML in the editor using Underscore JS
* template. The variables for the class are available using `data` JS
* object.
*
* @since 1.0.0
* @access public
*/
public function content_template() {
?>
! Hints::is_dismissed( 'image-optimization' ),
'type' => 'info',
'content' => $content_text,
'icon' => true,
'dismissible' => 'image_optimizer_hint',
'button_text' => $button_text,
'button_event' => 'image_optimizer_hint',
'button_data' => [
'action_url' => $action_url,
],
] ); ?>
true,
'dynamic' => [
'categories' => [ TagsModule::GALLERY_CATEGORY ],
'returnType' => 'object',
],
];
}
/**
* Get gallery control default values.
*
* Retrieve the default value of the gallery control. Used to return the default
* values while initializing the gallery control.
*
* @since 1.0.0
* @access public
*
* @return array Control default value.
*/
public function get_default_value() {
return [];
}
}