Advertisement
rejuancse

AA

Mar 18th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.71 KB | None | 0 0
  1. <?php
  2. # Plugins activation
  3. require_once( BIZNESS_INIT_PATH . 'plugins/class-tgm-plugin-activation.php' );
  4. add_action('tgmpa_register', 'bizness_register_required_plugins');
  5. function bizness_register_required_plugins() {
  6.  
  7.     $plugins = array(
  8.  
  9.         array(
  10.             'name'                  => esc_html__( 'The Bizness Extensions', 'bizness' ),
  11.             'slug'                  => 'the_bizness_extensions',
  12.             'source'                => esc_url('http://max-themes.com/wp/max-themes-updated-plugins/the_bizness_extensions.zip'),
  13.             'required'              => true,
  14.             'version'               => '',
  15.             'force_activation'      => false,
  16.             'force_deactivation'    => false,
  17.             'external_url'          => '',
  18.         ),
  19.         array(
  20.             'name'                  => esc_html__( 'WPBakery Visual Composer', 'bizness' ),
  21.             'slug'                  => 'js_composer',
  22.             'source'                => esc_url('http://max-themes.com/wp/max-themes-updated-plugins/js_composer.zip'),
  23.             'required'              => false,
  24.             'version'               => '',
  25.             'force_activation'      => false,
  26.             'force_deactivation'    => false,
  27.             'external_url'          => '',
  28.         ),
  29.         array(
  30.             'name'                  => esc_html( 'Slider Revolution', 'bizness' ),
  31.             'slug'                  => 'revslider',
  32.             'source'                => esc_url('http://max-themes.com/wp/max-themes-updated-plugins/revslider.zip'),
  33.             'required'              => true,
  34.             'version'               => '',
  35.             'force_activation'      => false,
  36.             'force_deactivation'    => false,
  37.             'external_url'          => '',
  38.         ),
  39.         array(
  40.             'name'                  => esc_html( 'The MXT Contact Form', 'bizness' ),
  41.             'slug'                  => 'the_mxt_contact_form',
  42.             'source'                => esc_url('http://max-themes.com/wp/max-themes-updated-plugins/the_mxt_contact_form.zip'),
  43.             'required'              => false,
  44.             'version'               => '1.0.0',
  45.             'force_activation'      => false,
  46.             'force_deactivation'    => false,
  47.             'external_url'          => '',
  48.         ),
  49.         array(
  50.             'name'                  => 'Woocoomerce',
  51.             'slug'                  => 'woocommerce',
  52.             'required'              => false,
  53.         ),
  54.         array(
  55.             'name'                  => esc_html__( 'Bizness Demo Importer', 'bizness' ),
  56.             'slug'                  => 'bizness-demo-importer',
  57.             'source'                => esc_url('http://max-themes.com/wp/max-themes-updated-plugins/bizness-demo-importer.zip'),
  58.             'required'              => false,
  59.             'version'               => '',
  60.             'force_activation'      => false,
  61.             'force_deactivation'    => false,
  62.             'external_url'          => '',
  63.         ),     
  64.         array(
  65.             'name'                  => esc_html( 'Widget Importer & Exporter', 'bizness' ),
  66.             'slug'                  => 'widget-importer-exporter',
  67.             'required'              => false,
  68.         ),     
  69.         array(
  70.             'name'                  => esc_html__( 'MailChimp for WordPress', 'bizness' ),
  71.             'slug'                  => 'mailchimp-for-wp',
  72.             'required'              => false,
  73.         ), 
  74.     );
  75.  
  76.     /**
  77.     * Array of configuration settings. Amend each line as needed.
  78.     * If you want the default strings to be available under your own theme domain,
  79.     * leave the strings uncommented.
  80.     * Some of the strings are added into a sprintf, so see the comments at the
  81.     * end of each line for what each argument will be.
  82.     */
  83.     $config = array(
  84.         'domain'            => 'bizness',           // Text domain - likely want to be the same as your theme.
  85.         'default_path'      => '',                          // Default absolute path to pre-packaged plugins
  86.         'parent_slug'       => 'themes.php',                // Default parent slug
  87.         'menu'              => 'install-required-plugins',  // Menu slug
  88.         'has_notices'       => true,                        // Show admin notices or not
  89.         'is_automatic'      => true,                        // Automatically activate plugins after installation or not
  90.         'message'           => '',                          // Message to output right before the plugins table
  91.         'strings'           => array(
  92.             'page_title'                                => esc_html( 'Install Required Plugins', 'bizness' ),
  93.             'menu_title'                                => esc_html( 'Install Plugins', 'bizness' ),
  94.             'installing'                                => esc_html( 'Installing Plugin: %s', 'bizness' ), // %1$s = plugin name
  95.             'oops'                                      => esc_html( 'Something went wrong with the plugin API.', 'bizness' ),
  96.             'notice_can_install_required'               => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'bizness' ), // %1$s = plugin name(s)
  97.             'notice_can_install_recommended'            => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'bizness' ), // %1$s = plugin name(s)
  98.             '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.', 'bizness' ), // %1$s = plugin name(s)
  99.             'notice_can_activate_required'              => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'bizness' ), // %1$s = plugin name(s)
  100.             'notice_can_activate_recommended'           => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'bizness' ), // %1$s = plugin name(s)
  101.             '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.', 'bizness' ), // %1$s = plugin name(s)
  102.             '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.', 'bizness' ), // %1$s = plugin name(s)
  103.             '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.', 'bizness' ), // %1$s = plugin name(s)
  104.             'install_link'                              => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'bizness' ),
  105.             'activate_link'                             => _n_noop( 'Activate installed plugin', 'Activate installed plugins', 'bizness' ),
  106.             'return'                                    => esc_html( 'Return to Required Plugins Installer', 'bizness' ),
  107.             'plugin_activated'                          => esc_html( 'Plugin activated successfully.', 'bizness' ),
  108.             'complete'                                  => esc_html( 'All plugins installed and activated successfully. %s', 'bizness' ), // %1$s = dashboard link
  109.             'nag_type'                                  => 'updated' // Determines admin notice type - can only be 'updated' or 'error'
  110.         )
  111.     );
  112.  
  113.     tgmpa($plugins, $config);
  114. }
  115.  
  116. /**
  117. * Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page
  118. */
  119. add_action( 'vc_before_init', 'bizness_vcSetAsTheme' );
  120. function bizness_vcSetAsTheme() {
  121.     vc_set_as_theme();
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement