Compare commits
2 Commits
410571a802
...
fix-36-whi
Author | SHA1 | Date | |
---|---|---|---|
9d33745b65 | |||
bb405f24f2 |
@ -137,9 +137,11 @@ class Sunrise {
|
|||||||
require_once __DIR__ . '/class-settings.php';
|
require_once __DIR__ . '/class-settings.php';
|
||||||
require_once __DIR__ . '/limits/class-plugin-limits.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__ . '/limits/class-theme-limits.php';
|
|
||||||
require_once __DIR__ . '/models/class-membership.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';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,9 +235,11 @@ final class WP_Ultimo {
|
|||||||
*/
|
*/
|
||||||
public function setup_textdomain(): void {
|
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');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +22,16 @@ defined('ABSPATH') || exit;
|
|||||||
function wu_get_asset($asset, $assets_dir = 'img', $base_dir = 'assets') {
|
function wu_get_asset($asset, $assets_dir = 'img', $base_dir = 'assets') {
|
||||||
|
|
||||||
if ( ! defined('SCRIPT_DEBUG') || ! SCRIPT_DEBUG) {
|
if ( ! defined('SCRIPT_DEBUG') || ! SCRIPT_DEBUG) {
|
||||||
$asset = preg_replace('/(?<!\.min)(\.js|\.css)/', '.min$1', $asset);
|
// Create the minified filename
|
||||||
|
$minified_asset = preg_replace('/(?<!\.min)(\.js|\.css)/', '.min$1', $asset);
|
||||||
|
|
||||||
|
// Check if the minified file exists
|
||||||
|
$minified_path = WP_ULTIMO_PLUGIN_DIR . "$base_dir/$assets_dir/$minified_asset";
|
||||||
|
|
||||||
|
// Only use the minified version if it exists
|
||||||
|
if (file_exists($minified_path)) {
|
||||||
|
$asset = $minified_asset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return wu_url("$base_dir/$assets_dir/$asset");
|
return wu_url("$base_dir/$assets_dir/$asset");
|
||||||
|
Reference in New Issue
Block a user