0

I am facing a problem with tgm i have just download the setup from tgm site

http://tgmpluginactivation.com/download/

and when i follow the steps as described on the site and in the downloaded zip file but after follow the steps when i activate my custom theme its simply activated its did not showing any message regarding activating the required plugins

my themes function.php file code is below

 <?php

require_once get_template_directory() . '/includes/class-tgm-plugin-activation.php';

add_action( 'tgmpa_register', 'custom_register_required_plugins' );


function custom_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(

        // This is an example of how to include a plugin bundled with a theme.
        array(
            'name'                  => esc_html__('Visual Composer','custom'),
            'slug'                  => 'js_composer',
            'source'                => get_template_directory() . '/plugins/js-composer.zip',
            'required'              => false,
            'version'               => '5.1.1',
            'force_activation'      => false,
            'force_deactivation'    => false,
            'external_url'          => '',
        ),


    );

    $config = array(
        'id'           => 'custom',                 // Unique ID for hashing notices for multiple instances of TGMPA.
        'default_path' => '',                      // Default absolute path to bundled plugins.
        'menu'         => 'tgmpa-install-plugins', // Menu slug.
        'has_notices'  => true,                    // 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 );

}

please tell me whats wrong in this code why after acitvate the theme did not show any message about activate the required plugins

Deepak Goyal
  • 1,186
  • 2
  • 13
  • 26
  • I can't see anything wrong unless you didn't use the GUI and used the repo in that case they say 'make sure you change the text domain (theme-slug) to the text domain of your theme or plugin' – Orlando P. Jun 01 '18 at 21:43
  • i have already done this but not working – Deepak Goyal Jun 02 '18 at 02:21
  • sorry guys problem solved a silly mistake i have done by mistake i create the file with name function.php insead of functions.php thanks for help – Deepak Goyal Jun 02 '18 at 02:37

0 Answers0