Skip to content
Brady Vercher edited this page Jan 12, 2016 · 1 revision

Testing

/**
 * Configure the client to use a testing server instead of production.
 */
add_action( 'plugins_loaded', function() {
	if ( ! function_exists( 'audiotheme_agent' ) ) {
		return;
	}

	audiotheme_agent()->client
		->set_base_url( 'https://audiotheme.dev/api' )
		->set_authorization_endpoint( 'https://audiotheme.dev/oauth2/authorize' )
		->set_registration_endpoint( 'https://audiotheme.dev/oauth2/regiter' )
		->set_subscription_endpoint( 'https://audiotheme.dev/oauth2/subscribe' )
		->set_token_endpoint( 'https://audiotheme.dev/oauth2/token' );
}, 5 );

/**
 * Disable SSL verification for local development to work around issues with
 * self-signed certificates.
 */
add_filter( 'http_request_args', function( $r, $url ) {
	if ( 0 === strpos( $url, 'https://audiotheme.dev' ) ) {
		$r['sslverify'] = false;
	}

	return $r;
}, 5, 2 );
Clone this wiki locally