'', 'path' => '']. */ class Sellkit_Elementor_Controls_File_Uploader extends Control_Base_Multiple { /** * File uplodaer control constructor. * * Adds ajax hook for file upload. * * @since 1.5.0 */ public function __construct() { parent::__construct(); // Register AJAX action. add_action( 'wp_ajax_sellkit_control_file_upload', [ $this, 'handle_file_upload' ] ); // Define nonce for file upload ajax action. add_action( 'elementor/editor/after_enqueue_scripts', function() { wp_localize_script( 'sellkit-editor', 'sellkitNonceEditorFileUploader', [ wp_create_nonce( 'sellkit_fileuploader_editor' ) ] ); }, 20 ); } /** * Get type of the control, used in declaring "type" when creating Elementor control. * * @return string * * @since 1.5.0 */ public function get_type() { return 'sellkit_file_uploader'; } /** * Get array of default values for this control. * * @return array * * @since 1.5.0 */ public function get_default_value() { return [ 'files' => [], ]; } /** * Get array of default settings for this control. * * @return array * * @since 1.5.0 */ protected function get_default_settings() { return [ 'label_block' => false, ]; } /** * Echo the template of this control in the Elementor's editor panel. * * @since 1.5.0 */ public function content_template() { ?>