config-tgm.php (8040B)
1 <?php 2 /* 3 * TGM 4 */ 5 if ( file_exists( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php') ) { 6 include_once( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php'); 7 } 8 9 class TGMRequiredPlugins 10 { 11 use pluginlist; 12 13 public function __construct() 14 { 15 add_action('tgmpa_register', array($this, 'welbim_register_required_plugins')); 16 } 17 18 public function welbim_register_required_plugins() 19 { 20 21 $plugins = array( 22 array( 23 'name' => esc_html__('Redux Framework', 'welbim'), // The plugin name 24 'slug' => 'redux-framework', // The plugin slug (typically the folder name) 25 'required' => true, // If false, the plugin is only 'recommended' instead of required 26 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch 27 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins 28 'external_url' => '', // If set, overrides default API URL and points to an external URL 29 ), 30 array( 31 'name' => esc_html__('Contact Form 7', 'welbim'), // The plugin name 32 'slug' => 'contact-form-7', // The plugin slug (typically the folder name) 33 'required' => true, // If false, the plugin is only 'recommended' instead of required 34 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch 35 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins 36 'external_url' => '', // If set, overrides default API URL and points to an external URL 37 ), 38 array( 39 'name' => esc_html__('Elementor', 'welbim'), // The plugin name 40 'slug' => 'elementor', // The plugin slug (typically the folder name) 41 'required' => true, // If false, the plugin is only 'recommended' instead of required 42 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch 43 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins 44 'external_url' => '', // If set, overrides default API URL and points to an external URL 45 ), 46 array( 47 'name' => esc_html__('Meta Box', 'welbim'), // The plugin name 48 'slug' => 'meta-box', // The plugin slug (typically the folder name) 49 'required' => true, // If false, the plugin is only 'recommended' instead of required 50 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch 51 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins 52 'external_url' => '', // If set, overrides default API URL and points to an external URL 53 ), 54 ); 55 56 $purchase_key = trim(get_option('envato_theme_license_key')); 57 $token = get_option('envato_theme_license_token'); 58 // Change this to your theme text domain, used for internationalising strings 59 foreach ($this->plugin_org_name as $key => $value) { 60 $array = array(); 61 $array['name'] = wp_kses_post($value); 62 $array['slug'] = $key; 63 $array['source'] = $this->update_url . 'ck-ensl-api?licence_action=downloadzip&ck-ensl-purchase-key=' . $purchase_key . '&item_id=' . $this->themeitem_id . '&site_url=' . get_site_url() . '&filename=' . $key . '&token=' . $token; 64 $array['required'] = true; 65 $array['force_activation'] = false; 66 $array['force_deactivation'] = false; 67 $array['external_url'] = ''; 68 $plugins[] = $array; 69 } 70 71 // Change this to your theme text domain, used for internationalising strings 72 73 $config = array( 74 'domain' => 'welbim', // Text domain - likely want to be the same as your theme. 75 'default_path' => '', // Default absolute path to pre-packaged plugins 76 'parent_slug' => 'themes.php', 77 'menu' => 'install-required-plugins', // Menu slug 78 'has_notices' => true, // Show admin notices or not 79 'is_automatic' => false, // Automatically activate plugins after installation or not 80 'message' => '', // Message to output right before the plugins table 81 'strings' => array( 82 'page_title' => esc_html__('Install Required Plugins', 'welbim'), 83 'menu_title' => esc_html__('Install Plugins', 'welbim'), 84 'installing' => esc_html__('Installing Plugin: %s', 'welbim'), // %1$s = plugin name 85 'oops' => esc_html__('Something went wrong with the plugin API.', 'welbim'), 86 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'welbim'), // %1$s = plugin name(s) 87 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'welbim'), // %1$s = plugin name(s) 88 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'welbim'), // %1$s = plugin name(s) 89 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'welbim'), // %1$s = plugin name(s) 90 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'welbim'), // %1$s = plugin name(s) 91 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'welbim'), // %1$s = plugin name(s) 92 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'welbim'), // %1$s = plugin name(s) 93 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'welbim'), // %1$s = plugin name(s) 94 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins', 'welbim'), 95 'activate_link' => _n_noop('Activate installed plugin', 'Activate installed plugins', 'welbim'), 96 'return' => esc_html__('Return to Required Plugins Installer', 'welbim'), 97 'plugin_activated' => esc_html__('Plugin activated successfully.', 'welbim'), 98 'complete' => esc_html__('All plugins installed and activated successfully. %s', 'welbim'), // %1$s = dashboard link 99 'nag_type' => 'updated', // Determines admin notice type - can only be 'updated' or 'error' 100 ), 101 ); 102 103 tgmpa($plugins, $config); 104 } 105 } 106 new TGMRequiredPlugins();