Skip to content

Commit

Permalink
Updated coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
zohaib87 committed Oct 5, 2023
1 parent adf9959 commit 6953c1e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 93 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Required plugins activation.
*/
require get_template_directory() . '/helpers/plugins-activator.php';
require get_template_directory() . '/helpers/class-plugins-activator.php';

/**
* Class that holds helper methods.
Expand Down
85 changes: 85 additions & 0 deletions helpers/class-plugins-activator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* Register the required plugins for this theme.
*
* @link http://tgmpluginactivation.com/configuration/
*
* @package _xe
*/

namespace Xe_Theme\Helpers;

class Plugins_Activator {

function __construct() {

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

add_action( 'tgmpa_register', [ $this, 'register_required_plugins' ] );

}

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

// Include a plugin from the WordPress Plugin Repository.
array(
'name' => 'Elementor Website Builder',
'slug' => 'elementor',
'required' => false,
),
array(
'name' => 'Kirki Customizer Framework',
'slug' => 'kirki',
'required' => true,
),
array(
'name' => 'Meta Box',
'slug' => 'meta-box',
'required' => true,
),
array(
'name' => 'Max Mega Menu',
'slug' => 'megamenu',
'required' => true,
),
array(
'name' => 'WooCommerce',
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => 'Contact Form 7',
'slug' => 'contact-form-7',
'required' => false,
)

);

/**
* Array of configuration settings. Amend each line as needed.
*/
$config = array(
'id' => 'tgmpa',
'default_path' => '',
'menu' => 'install-plugins',
'parent_slug' => 'themes.php',
'capability' => 'edit_theme_options',
'has_notices' => true,
'dismissable' => true,
'dismiss_msg' => '',
'is_automatic' => false,
'message' => '',
);

tgmpa( $plugins, $config );

}

}
new Plugins_Activator();
92 changes: 0 additions & 92 deletions helpers/plugins-activator.php

This file was deleted.

0 comments on commit 6953c1e

Please sign in to comment.