Skip to content

Commit

Permalink
Fix: Load textdomain on init action hook (#7631)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjohnson authored Nov 25, 2024
1 parent d056e04 commit 9f915d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public function __construct()
/**
* Init Give when WordPress Initializes.
*
* @unreleased Move the loading of the `give` textdomain to the `init` action hook.
* @since 1.8.9
*/
public function init()
Expand All @@ -279,9 +280,6 @@ public function init()
*/
do_action('before_give_init');

// Set up localization.
$this->load_textdomain();

$this->bindClasses();

$this->setupExceptionHandler();
Expand Down Expand Up @@ -379,6 +377,7 @@ private function loadServiceProviders()
/**
* Bootstraps the Give Plugin
*
* @unreleased Load the `give` textdomain on the `init` action hook.
* @since 2.8.0
*/
public function boot()
Expand All @@ -392,6 +391,9 @@ public function boot()

add_action('plugins_loaded', [$this, 'init'], 0);

// Set up localization.
add_action('init', [$this, 'load_textdomain']);

register_activation_hook(GIVE_PLUGIN_FILE, [$this, 'install']);

do_action('give_loaded');
Expand Down

0 comments on commit 9f915d2

Please sign in to comment.