From bb405f24f2ab7adc3333dda5ad8bf8b9692e723f Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Tue, 15 Apr 2025 00:05:50 +0100 Subject: [PATCH] Fix issues #10 and #15: Move Site_Query loading to Sunrise class and fix textdomain loading --- inc/class-sunrise.php | 4 +++- inc/class-wp-ultimo.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/class-sunrise.php b/inc/class-sunrise.php index c7240db..6a02c6b 100644 --- a/inc/class-sunrise.php +++ b/inc/class-sunrise.php @@ -137,9 +137,11 @@ class Sunrise { require_once __DIR__ . '/class-settings.php'; require_once __DIR__ . '/limits/class-plugin-limits.php'; require_once __DIR__ . '/limits/class-theme-limits.php'; - require_once __DIR__ . '/limits/class-theme-limits.php'; require_once __DIR__ . '/models/class-membership.php'; + // Make sure we have all the necessary database classes loaded + require_once __DIR__ . '/database/sites/class-sites-schema.php'; + } /** diff --git a/inc/class-wp-ultimo.php b/inc/class-wp-ultimo.php index 315c4a3..508bf01 100644 --- a/inc/class-wp-ultimo.php +++ b/inc/class-wp-ultimo.php @@ -235,9 +235,11 @@ final class WP_Ultimo { */ public function setup_textdomain(): void { /* - * Loads the translation files. + * Loads the translation files at the init action to prevent "too early" warnings in WP 6.7+ */ - load_plugin_textdomain('wp-ultimo', false, dirname((string) WP_ULTIMO_PLUGIN_BASENAME) . '/lang'); + add_action('init', function() { + load_plugin_textdomain('wp-ultimo', false, dirname((string) WP_ULTIMO_PLUGIN_BASENAME) . '/lang'); + }); } /**