Inventory_Presser_Map_Widget::__construct()

__construct


Description

Calls the parent class' contructor and adds a hook that will delete the option that stores this widget's data when the plugin's delete all data method is run.


Return

(void)


Source

File: includes/widget/class-widget-map.php

	function __construct() {
		parent::__construct(
			self::ID_BASE,
			__( 'Map', 'inventory-presser' ),
			array(
				'description'           => __( 'Embeds a map pointed at a dealership address.', 'inventory-presser' ),
				'show_instance_in_rest' => true,
			)
		);

		add_action( 'invp_delete_all_data', array( $this, 'delete_option' ) );

		// Register script and style files for leaflet.js
		wp_register_script( self::SCRIPT_HANDLE_LEAFLET, plugins_url( 'js/leaflet/leaflet.js', INVP_PLUGIN_FILE_PATH ) );
		wp_register_style( self::SCRIPT_HANDLE_LEAFLET, plugins_url( 'js/leaflet/leaflet.min.css', INVP_PLUGIN_FILE_PATH ) );
		wp_register_style( self::ID_BASE, plugins_url( 'css/widget-map.min.css', INVP_PLUGIN_FILE_PATH ) );
	}