/** * @return tubepress_api_url_UrlInterface */ private function _startAdminUrl($pageSlug, tubepress_spi_http_oauth2_Oauth2ProviderInterface $provider) { $asString = $this->_wpFunctions->admin_url('admin.php'); $toReturn = $this->_urlFactory->fromString($asString); $providerName = $provider->getName(); $toReturn->getQuery()->set('page', $pageSlug)->set('provider', $providerName)->set('csrf_token', $this->getCsrfSecret()); return $toReturn; }
/** * {@inheritdoc} */ public function getAjaxEndpointUrl() { if (!$this->_properties->containsKey(self::$_PROPERTY_URL_AJAX)) { /* * See if it was defined in boot settings. */ $fromBootSettings = $this->_bootSettings->getUrlAjaxEndpoint(); if ($fromBootSettings) { $this->_properties->put(self::$_PROPERTY_URL_AJAX, $fromBootSettings); return $fromBootSettings; } if ($this->_isWordPress()) { $url = $this->_wpFunctionsInterface->admin_url('admin-ajax.php'); } else { $url = $this->getBaseUrl()->getClone()->setPath('/web/php/ajaxEndpoint.php'); } $url = $this->_toUrl($url); $this->_properties->put(self::$_PROPERTY_URL_AJAX, $url); } return $this->_properties->get(self::$_PROPERTY_URL_AJAX); }