ldc-groupe/content/plugins/wpml-translation-management/classes/translation-proxy/services/Project/SiteDetails.php
Vincent BRIDIER 134507db43 - Backup DEV
- Add DotEnv
- Fix Bato
- Etc..
2020-05-04 15:59:02 +02:00

48 lines
No EOL
914 B
PHP

<?php
namespace WPML\TM\TranslationProxy\Services\Project;
class SiteDetails {
/** @var \SitePress */
private $sitepress;
/**
* @param \SitePress $sitepress
*/
public function __construct( \SitePress $sitepress ) {
$this->sitepress = $sitepress;
}
/**
* @return string
*/
public function getDeliveryMethod() {
return (int) $this->sitepress->get_setting( 'translation_pickup_method' ) === ICL_PRO_TRANSLATION_PICKUP_XMLRPC
? "xmlrpc"
: "polling";
}
/**
* @return array
*/
public function getBlogInfo() {
return [
'url' => get_option( 'siteurl' ),
'name' => get_option( 'blogname' ),
'description' => get_option( 'blogdescription' ),
];
}
/**
* @return array
*/
public function getClientData() {
$current_user = wp_get_current_user();
return [
'email' => $current_user->user_email,
'name' => $current_user->display_name,
];
}
}