Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter urcomm

    (@urcomm)

    It looks like WP-CLI (http://wp-cli.org) does what we want, and a lot more besides, for both normal and multisite installs, so we’ll use that 🙂

    Thread Starter urcomm

    (@urcomm)

    Heh, figures. We actually do it as suggested;

    "require( dirname( __FILE__ ) . '/wp-blog-header.php' ); echo network_site_url();"

    But I ended up experimenting with various things, initializing the whole environment seemed needlessly complex, so the ‘wp-config.php’ was the last thing I tried before starting this thread.

    Anyway, what we’re trying to do is have a reliable way to detect the site URL for any given WordPress install on our servers, whether they’re in the root of a domain, any subdirectory, or on subdomains where the user has selected a different path for their DocumentRoot. Basically, it should yield a simple URL string we can tack ‘/wp-cron.php…’ onto, without putting our own code in the customer’s directory. The URL is then called by a shell script.

    As I read the Codex, ‘network_site_url()’ should cover the multisite use case, but it looks like that fails. Is there a better way to do this, preferably without needing to query the database directly?

Viewing 2 replies - 1 through 2 (of 2 total)