private function _getUserAgent() { $toReturn = (string) 'tubepress/' . $this->_environment->getVersion(); if (extension_loaded('curl')) { $curlVersion = curl_version(); $toReturn .= ' curl/' . $curlVersion['version']; } $toReturn .= ' PHP/' . PHP_VERSION; return $toReturn; }
public function onAction_init(tubepress_api_event_EventInterface $event) { /* no need to queue any of this stuff up in the admin section or login page */ if ($this->_wpFunctions->is_admin() || __FILE__ === 'wp-login.php') { return; } $baseName = basename(TUBEPRESS_ROOT); $ajaxUrl = $this->_wpFunctions->plugins_url('web/js/wordpress-ajax.js', "{$baseName}/tubepress.php"); $version = $this->_environment->getVersion(); $this->_wpFunctions->wp_register_script('tubepress_ajax', $ajaxUrl, array('tubepress'), "{$version}"); $this->_wpFunctions->wp_enqueue_script('jquery', false, array(), false, false); $this->_wpFunctions->wp_enqueue_script('tubepress_ajax', false, array(), false, false); $this->_enqueueThemeResources($this->_wpFunctions, $version); }