This presentation shows practical experience working with social networks in WordPress. Speech held at conference WordPress kitchen (05.10.2013 Kiev, Ukraine) by Mikhail Gorishnyi
15. Facebook
onnectС
onnectС
// set up Facebook app
$this->facebook = new Facebook(array(
"appId" => $this->appId,
"secret" => $this->secret,
));
// See if there is a user from a cookie
$this->user = $this->facebook->getUser();
16. Получение активности
пользователя
пользователя
public function getFeedData() {
return $this->facebook->api('/me/feed', 'GET', array(
'since' => $this->feedParams['since'],
'until' => $this->feedParams['until'],
'limit' => $this->facebookPostLimit
));
}
17. Обработка переменных
Фабрика методов
Фабрика методов
private function factory() {
foreach (array_keys($this->_workArray) as $key) {
$func = 'insert' . ucfirst($key);
if (method_exists($this, $func)) {
$this->$func();
} else {
$this->_workArray[$key] = '';
}
}
}