Skip to main content

Updates to WordPress (Composer Managed) Upstream

April 15, 2024

An update is now available for the WordPress (Composer Managed) upstream to resolve a particular log message that started appearing after our WP-CLI wrapper update in February.

This update adds a new file to the /config directory, application.pantheon.php. In order to accomodate this new file, a line has been added to config/application.php to load the config/application.pantheon.php file. If you have made modifications to your config/application.php, it's possible you may run into conflicts with this update. If this is the case, you can manually resolve by running the following command:

git pull -Xtheirs main
git push origin master

For more help or assistance about managing potential merge conflicts, refer to our documentation on auto-resolving via the dashboard or manually resolving via the command line.

Technical Details

The application.pantheon.php file curently contains code to check for a defined WP_HOME value in the site's .env file. If the value is undefined or no .env file is being used, values for WP_HOME and WP_SITEURL are defined. This can be overridden by either adding values to the site's .env file or adding putenv( 'WP_HOME=' ); and putenv( 'WP_SITEURL=' ); to your application.php file.

Why the change?

Roots Bedrock makes heavy use of environment variables. We made an intentional decision to not rely on .env files in order to reduce overall complexity. This left WP_HOME and WP_SITEURL undefined in the application.php file except in local development with Lando. In most cases, WordPress is intelligent enough to use the database values for home and siteurl for normal interactions, however, this caused problems with WP-CLI operations. The addition of a new application.pantheon.php file allows us to define those values if they are not already while still allowing them to be overridden for more complex environments.