Skip to content

Commit

Permalink
Move required file to __construct
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Dec 3, 2024
1 parent a0f2f9d commit 3c43c93
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions obfx_modules/companion-legacy/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,14 @@ class Companion_Legacy_OBFX_Module extends Orbit_Fox_Module_Abstract {
public function __construct() {
parent::__construct();

$this->active_default = true;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$this->inc_dir = $this->get_dir() . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR;
if ( ! defined( 'THEMEISLE_COMPANION_PATH' ) ) {
define( 'THEMEISLE_COMPANION_PATH', $this->inc_dir );
}
if ( ! defined( 'THEMEISLE_COMPANION_URL' ) ) {
define( 'THEMEISLE_COMPANION_URL', plugin_dir_url( $this->inc_dir ) );
}
$theme_name = '';
if ( $this->is_zerif() ) {
$theme_name = 'Zerif';
require_once $this->inc_dir . 'zerif-lite' . DIRECTORY_SEPARATOR . 'widgets' . DIRECTORY_SEPARATOR . 'widget-focus.php';
require_once $this->inc_dir . 'zerif-lite' . DIRECTORY_SEPARATOR . 'widgets' . DIRECTORY_SEPARATOR . 'widget-testimonial.php';
require_once $this->inc_dir . 'zerif-lite' . DIRECTORY_SEPARATOR . 'widgets' . DIRECTORY_SEPARATOR . 'widget-clients.php';
Expand All @@ -57,12 +46,33 @@ public function set_module_strings() {
if ( $this->is_hestia() ) {
require_once $this->inc_dir . 'hestia' . DIRECTORY_SEPARATOR . 'functions.php';
require_once $this->inc_dir . 'hestia' . DIRECTORY_SEPARATOR . 'common-functions.php';
$theme_name = 'Hestia';

}

if ( $this->is_hestia_pro() ) {
require_once $this->inc_dir . 'hestia' . DIRECTORY_SEPARATOR . 'common-functions.php';

}
$this->active_default = true;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$theme_name = '';
if ( $this->is_zerif() ) {
$theme_name = 'Zerif';
}

if ( $this->is_hestia() ) {
$theme_name = 'Hestia';

}

if ( $this->is_hestia_pro() ) {
$theme_name = 'Hestia Pro';

}
Expand Down

0 comments on commit 3c43c93

Please sign in to comment.