<?php
/**
 * TGM Init Class
 *
 * @package   Matchday
 * @since     1.0.0
 * @version   1.0.1
 */

if (!function_exists('matchday_register_plugins')) {
	function matchday_register_plugins() {
		$plugins = [
			[
				'name' => 'Contact Form 7',
				'slug' => 'contact-form-7',
				'required' => false,
			],
			[
				'name' => 'Dynamic Year Block',
				'slug' => 'dynamic-year-block',
				'required' => false,
			],
			[
				'name' => 'Matchday Blocks',
				'slug' => 'matchday-blocks',
				'required' => false,
			],
			[
				'name' => 'Splide Carousel Block',
				'slug' => 'splide-carousel',
				'required' => false,
			],
		];

		$config = [
			'id' => 'matchday', // Unique ID for hashing notices for multiple instances of TGMPA.
			'default_path' => '', // Default absolute path to pre-packaged plugins
			'menu' => 'tgmpa-install-plugins', // Menu slug
			'has_notices' => true, // Show admin notices or not
			'is_automatic' => false, // Automatically activate plugins after installation or not
			'dismissable' => true, // If false, a user cannot dismiss the nag message.
			'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
			'message' => '',
		];

		tgmpa($plugins, $config);
	}
}

add_action('tgmpa_register', 'matchday_register_plugins');
