Skip to content

Commit

Permalink
Fix textdomain loading issue with WP 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Nov 27, 2024
1 parent 8ee0fa3 commit a0f2f9d
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 26 deletions.
9 changes: 9 additions & 0 deletions core/app/abstract/class-orbit-fox-module-abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public function __construct() {
*/
public function register_loader( Orbit_Fox_Loader $loader ) {
$this->loader = $loader;
$this->loader->add_action( 'init', $this, 'set_module_strings' );
$this->loader->add_action( $this->get_slug() . '_activate', $this, 'activate' );
$this->loader->add_action( $this->get_slug() . '_deactivate', $this, 'deactivate' );
}
Expand Down Expand Up @@ -824,4 +825,12 @@ protected function check_new_user( $option_name = 'obfx_new_user' ) {
update_option( $option_name, 'no' );
return false;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
}
}
11 changes: 10 additions & 1 deletion obfx_modules/beaver-widgets/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ class Beaver_Widgets_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->name = __( 'Page builder widgets', 'themeisle-companion' );
$this->description = __( 'Adds widgets to the most popular builders: Elementor or Beaver. More to come!', 'themeisle-companion' );
$this->active_default = true;
}

/**
Expand Down
8 changes: 7 additions & 1 deletion obfx_modules/companion-legacy/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ 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 );
Expand All @@ -47,7 +54,6 @@ public function __construct() {
require_once $this->inc_dir . 'zerif-lite' . DIRECTORY_SEPARATOR . 'functions.php';
}


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';
Expand Down
13 changes: 11 additions & 2 deletions obfx_modules/custom-fonts/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ class Custom_Fonts_OBFX_Module extends Orbit_Fox_Module_Abstract {
*/
public function __construct() {
parent::__construct();
$this->name = __( 'Custom fonts', 'themeisle-companion' );
$this->description = __( 'Upload custom fonts and use them anywhere on your site.', 'themeisle-companion' );

$this->active_default = false;
$this->refresh_after_enabled = true;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$this->name = __( 'Custom fonts', 'themeisle-companion' );
$this->description = __( 'Upload custom fonts and use them anywhere on your site.', 'themeisle-companion' );
}

/**
* Determine if module should be loaded.
*
Expand Down
12 changes: 10 additions & 2 deletions obfx_modules/elementor-widgets/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class Elementor_Widgets_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->name = __( 'Page builder widgets', 'themeisle-companion' );
$this->description = __( 'Adds widgets to the most popular builders: Elementor or Beaver. More to come!', 'themeisle-companion' );

Expand Down Expand Up @@ -60,8 +70,6 @@ public function __construct() {
</a>
</div>';
}

$this->active_default = true;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions obfx_modules/google-analytics/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
private $api_url = 'https://analytics.orbitfox.com/api/pirate-bridge/v1';

/**
* Test_OBFX_Module constructor.
* Setup module strings
*
* @since 4.0.3
* @access public
*/
public function __construct() {
parent::__construct();
public function set_module_strings() {
$this->name = __( 'Analytics Integration', 'themeisle-companion' );
$this->description = __( 'A module to integrate Google Analytics into your site easily.', 'themeisle-companion' );
}
Expand Down
12 changes: 10 additions & 2 deletions obfx_modules/header-footer-scripts/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ class Header_Footer_Scripts_OBFX_Module extends Orbit_Fox_Module_Abstract {
*/
public function __construct() {
parent::__construct();
$this->name = __( 'Header Footer Scripts', 'themeisle-companion' );

$this->description = __( 'An easy way to add scripts, such as tracking and analytics scripts, to the header and footer of your website, as well as in the body of your posts and pages.', 'themeisle-companion' );
$this->active_default = true;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$this->name = __( 'Header Footer Scripts', 'themeisle-companion' );
$this->description = __( 'An easy way to add scripts, such as tracking and analytics scripts, to the header and footer of your website, as well as in the body of your posts and pages.', 'themeisle-companion' );
$this->meta_controls = array(
'obfx-header-scripts' => array(
'type' => 'textarea',
Expand Down
13 changes: 11 additions & 2 deletions obfx_modules/menu-icons/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,22 @@ class Menu_Icons_OBFX_Module extends Orbit_Fox_Module_Abstract {
*/
public function __construct() {
parent::__construct();
$this->name = __( 'Menu Icons', 'themeisle-companion' );
$this->description = __( 'Module to define menu icons for navigation.', 'themeisle-companion' );

$this->active_default = true;

add_action( 'admin_init', array( $this, 'check_conflict' ), 99 );
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$this->name = __( 'Menu Icons', 'themeisle-companion' );
$this->description = __( 'Module to define menu icons for navigation.', 'themeisle-companion' );
}


/**
* Determine if module should be loaded.
Expand Down
11 changes: 10 additions & 1 deletion obfx_modules/mystock-import/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,18 @@ class Mystock_Import_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->name = __( 'Mystock Import', 'themeisle-companion' );
$this->description = __( 'Module to import images directly from', 'themeisle-companion' ) . sprintf( ' <a href="%s" target="_blank">mystock.photos</a>', 'https://mystock.photos' );
$this->active_default = true;
}


Expand Down
7 changes: 2 additions & 5 deletions obfx_modules/policy-notice/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
class Policy_Notice_OBFX_Module extends Orbit_Fox_Module_Abstract {

/**
* Test_OBFX_Module constructor.
* Setup module strings
*
* @since 1.0.0
* @access public
*/
public function __construct() {
parent::__construct();

public function set_module_strings() {
$this->name = __( 'Policy Notice', 'themeisle-companion' );
$this->description = __( 'A simple notice bar which will help you inform users about your website policy.', 'themeisle-companion' );
}
Expand Down
6 changes: 2 additions & 4 deletions obfx_modules/social-sharing/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ class Social_Sharing_OBFX_Module extends Orbit_Fox_Module_Abstract {
private $social_share_links = array();

/**
* Social_Sharing_OBFX_Module constructor.
* Setup module strings
*
* @since 1.0.0
* @access public
*/
public function __construct() {
parent::__construct();
public function set_module_strings() {
$this->name = __( 'Social Sharing Module', 'themeisle-companion' );
/*
* translators: %s Document anchor link.
Expand Down
13 changes: 11 additions & 2 deletions obfx_modules/template-directory/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ class Template_Directory_OBFX_Module extends Orbit_Fox_Module_Abstract {
*/
public function __construct() {
parent::__construct();
$this->name = __( 'Template Directory Module', 'themeisle-companion' );
$this->description = __( 'The awesome template directory is aiming to provide a wide range of templates that you can import straight into your website.', 'themeisle-companion' );

$this->active_default = false;
$this->refresh_after_enabled = true;
}

/**
* Setup module strings
*
* @access public
*/
public function set_module_strings() {
$this->name = __( 'Template Directory Module', 'themeisle-companion' );
$this->description = __( 'The awesome template directory is aiming to provide a wide range of templates that you can import straight into your website.', 'themeisle-companion' );
}

/**
* Determine if module should be loaded.
*
Expand Down

0 comments on commit a0f2f9d

Please sign in to comment.