From 233447f05e238b54a6d28e2160d51167a368cd89 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 30 Apr 2024 12:23:32 -0600 Subject: [PATCH] Add PANTHEON_HOSTNAME constant to wp-config-pantheon.php. For more information, see https://docs.pantheon.io/guides/multisite/config --- wp-config-pantheon.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-config-pantheon.php b/wp-config-pantheon.php index d19615bff..b47c51e9a 100644 --- a/wp-config-pantheon.php +++ b/wp-config-pantheon.php @@ -96,6 +96,13 @@ * To override, define your constant in your wp-config.php before wp-config-pantheon.php is required. */ +if ( ! defined('PANTHEON_HOSTNAME' ) ) { + $site_name = $_ENV['PANTHEON_SITE_NAME']; + $hostname = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : $_ENV['PANTHEON_ENVIRONMENT'] . "-{$site_name}.pantheonsite.io" ; + $hostname = isset( $_ENV['LANDO'] ) ? "{$site_name}.lndo.site" : $hostname; + define( 'PANTHEON_HOSTNAME', $hostname ); +} + /** Disable wp-cron.php from running on every page load and rely on Pantheon to run cron via wp-cli */ $network = isset($_ENV["FRAMEWORK"]) && $_ENV["FRAMEWORK"] === "wordpress_network"; if ( ! defined( 'DISABLE_WP_CRON' ) && $network === false) {