Skip to content

Commit

Permalink
Add PANTHEON_HOSTNAME constant to wp-config-pantheon.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence authored and Pantheon Automation committed May 7, 2024
1 parent ecc4717 commit 233447f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wp-config-pantheon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 233447f

Please sign in to comment.