On my Civi WordPress multisite installation, I just discovered that there is a wpLoadPhp
setting in the CiviCRM settings for each Civi domain that contains the absolute filesystem path to wp-load.php
(for example: /home/myusername/sites/mydomain.org/wp-load.php
). So this setting needs to be updated if I move WordPress+Civi to a new location, or move a copy of the Civi database to a development or test installation.
I discovered this setting when the Civi cv
CLI tool misbehaved—it tried to load settings from the wrong WordPress installation for a cv api setting.create ...
command. (However, using the WP-CLI wp cv api setting.create ...
worked correctly. It must override the Civi wpLoadPhp
setting.)
What is the correct/best way to update the wpLoadPhp
setting—preferably via a script for automation? Is wp cv api setting.create ...
best? It seems to work OK: e.g. wp cv api setting.create wpLoadPhp=/home/myusername/sites/mydomain.org/wp-load.php
.