Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay load_plugin_textdomain to init and set Domain Path #4036

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions elasticpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: elasticpress
* Domain Path: /lang
*
* This program derives work from Alley Interactive's SearchPress
* and Automattic's VIP search plugin:
Expand Down Expand Up @@ -275,15 +276,23 @@ function handle_upgrades() {
* @since 2.2
*/
function setup_misc() {
load_plugin_textdomain( 'elasticpress', false, basename( __DIR__ ) . '/lang' ); // Load any available translations first.

if ( is_user_logged_in() && ! defined( 'WP_EP_DEBUG' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
define( 'WP_EP_DEBUG', is_plugin_active( 'debug-bar-elasticpress/debug-bar-elasticpress.php' ) );
}
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\setup_misc' );

/**
* Load text domain
*
* @since 5.1.4
*/
function i18n() {
load_plugin_textdomain( 'elasticpress', false, basename( __DIR__ ) . '/lang' );
}
add_action( 'init', __NAMESPACE__ . '\i18n' );

/**
* Set up role(s) with EP capability
*/
Expand Down
Loading