WP_CLI

Runner::maybe_update_url_from_domain_constant()privateWP-CLI 1.0

Called after wp-config.php is eval'd, to potentially reset --url

Method of the class: Runner{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->maybe_update_url_from_domain_constant();

Runner::maybe_update_url_from_domain_constant() code WP-CLI 2.8.0-alpha

private function maybe_update_url_from_domain_constant() {
	if ( ! empty( $this->config['url'] ) || ! empty( $this->config['blog'] ) ) {
		return;
	}

	if ( defined( 'DOMAIN_CURRENT_SITE' ) ) {
		$url = DOMAIN_CURRENT_SITE;
		if ( defined( 'PATH_CURRENT_SITE' ) ) {
			$url .= PATH_CURRENT_SITE;
		}
		WP_CLI::set_url( $url );
	}
}