<?php


function edumodo_register_required_plugins() {
    /*
     * Array of plugin arrays. Required keys are name and slug.
     * If the source is NOT from the .org repo, then source is also required.
     */

    $plugins = array(
        array(
            'name'     => esc_html__('Kirki Customizer Framework', 'edumodo'),
            'slug'     => 'kirki',
            'required' => true,
        ),
        array(
            'name'     => esc_html('Edumodo Core', 'edumodo'),
            'slug'     => 'edumodo-core',
            'source'   =>  get_template_directory() . '/plugin/edumodo-core.zip', // The plugin source.
            'required' => true,
            'version'  => '3.0.0',
        ),
        array(
            'name'     => esc_html__('Elementor Page Builder', 'edumodo'),
            'slug'     => 'elementor',
            'required' => true,
        ),
        array(
            'name'     => esc_html__('Breadcrumb NavXT', 'edumodo'),
            'slug'     => 'breadcrumb-navxt',
            'required' => false,
        ),
        array(
            'name'     => esc_html('Revolution Slider', 'edumodo'),
            'slug'     => 'revslider',
            'source'   =>  get_template_directory() . '/plugin/revslider.zip', // The plugin source.
            'required' => false,
        ),
        array(
            'name'     => esc_html__('CMB2', 'edumodo'),
            'slug'     => 'cmb2',
            'required' => true,
        ),
        array(
            'name'     => esc_html__('Fluent Form', 'edumodo'),
            'slug'     => 'fluentform',
            'required' => true,
        ),
        array(
            'name'     => esc_html('WooCommerce', 'edumodo'),
            'slug'     => 'woocommerce',
            'required' => false
        ),
        array(
            'name'     => esc_html('The Events Calender', 'edumodo'),
            'slug'     => 'the-events-calendar',
            'required' => false
        ),
        array(
            'name'     => esc_html__('WidgetKit for Elementor', 'edumodo'),
            'slug'     => 'widgetkit-for-elementor',
            'required' => false,
        ),
        array(
            'name'     => esc_html('LearnPress - WordPress LMS', 'edumodo'),
            'slug'     => 'learnpress',
            'required' => false,
        ),
        array(
            'name'     => esc_html('LearnPress – Course Review', 'edumodo'),
            'slug'     => 'learnpress-course-review',
            'required' => false,
        ),
        array(
            'name'     => esc_html('Font Awesome', 'edumodo'),
            'slug'     => 'font-awesome',
            'required' => false,
        ),
        array(
            'name'     => esc_html('WidgetKit Pro', 'edumodo'),
            'slug'     => 'widgetkit-pro',
            'source'   =>  get_template_directory() . '/plugin/widgetkit-pro.zip', // The plugin source.
            'required' => true,
            // 'version'  => '3.0.0',
        ),
    );

    $config = array(
		'id'           => 'tgmpa',                 // Unique ID for hashing notices for multiple instances of TGMPA.
		'default_path' => '',                      // Default absolute path to bundled plugins.
		'menu'         => 'tgmpa-install-plugins', // Menu slug.
		'parent_slug'  => 'themes.php',            // Parent menu slug.
		'capability'   => 'edit_theme_options',    // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
		'has_notices'  => false,                    // Show admin notices 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.
		'is_automatic' => false,                   // Automatically activate plugins after installation or not.
		'message'      => '',                      // Message to output right before the plugins table.
	);

    tgmpa($plugins,$config);

}

add_action( 'tgmpa_register', 'edumodo_register_required_plugins' );