source/php/Module/Social/Feed.php
protected function renderFacebook()
    {
        $int = 0;

        if (isset($this->feedData->error->message)) {
            $this->addError($this->feedData->error->message);
            return;
        }

        if (!empty($this->feedData)) {
            foreach ((array) $this->feedData as $item) {
                $int++;

                $date = new \DateTime($item->created_time);
                $timeZone = new \DateTimeZone(!empty(get_option('timezone_string')) ? get_option('timezone_string') : date_default_timezone_get());
                $date->setTimezone($timeZone);

                $this->addStory(
                    strtotime($date->format('Y-m-d H:i:s')),
                    array(
                        'name' => $item->from->name,
                        'picture' => '//graph.facebook.com/' . $item->from->id . '/picture?type=large'
                    ),
                    isset($item->message) ? $item->message : '',
                    array(
                        'type'         => isset($item->type) ? $item->type : null,
                        'status_type'  => isset($item->status_type) ? $item->status_type : null,
                        'name'         => isset($item->name) ? $item->name : null,
                        'description'  => isset($item->description) ? $item->description : null,
                        'caption'      => isset($item->caption) ? $item->caption : null,
                        'link'         => isset($item->link) ? $item->link : null,
                        'full_picture' => isset($item->full_picture) ? $item->full_picture : null
                    )
                );

                if ($int == $this->args['length']) {
                    break;
                }
            }
        }
    }
protected function renderFacebook()
    {
        $int = 0;

        if (isset($this->feedData->error->message)) {
            $this->addError($this->feedData->error->message);
            return;
        }

        if (!empty($this->feedData)) {
            foreach ((array) $this->feedData as $item) {
                $int++;

                $date = new \DateTime($item->created_time);
                $timeZone = new \DateTimeZone(!empty(get_option('timezone_string')) ? get_option('timezone_string') : date_default_timezone_get());
                $date->setTimezone($timeZone);

                $this->addStory(
                    strtotime($date->format('Y-m-d H:i:s')),
                    array(
                        'name' => $item->from->name,
                        'picture' => '//graph.facebook.com/' . $item->from->id . '/picture?type=large'
                    ),
                    isset($item->message) ? $item->message : '',
                    array(
                        'type'         => isset($item->type) ? $item->type : null,
                        'status_type'  => isset($item->status_type) ? $item->status_type : null,
                        'name'         => isset($item->name) ? $item->name : null,
                        'description'  => isset($item->description) ? $item->description : null,
                        'caption'      => isset($item->caption) ? $item->caption : null,
                        'link'         => isset($item->link) ? $item->link : null,
                        'full_picture' => isset($item->full_picture) ? $item->full_picture : null
                    )
                );

                if ($int == $this->args['length']) {
                    break;
                }
            }
        }
    }
protected function renderFacebook ( ) { $ int = 0 ; if ( isset ( $ this -> feedData -> error -> message ) ) { $ this -> addError ( $ this -> feedData -> error -> message ) ; return ; } if ( ! empty ( $ this -> feedData ) ) { foreach ( ( array ) $ this -> feedData as $ item ) { $ int ++ ; $ date = new \ DateTime ( $ item -> created_time ) ; $ timeZone = new \ DateTimeZone ( ! empty ( get_option ( 'timezone_string' ) ) ? get_option ( 'timezone_string' ) : date_default_timezone_get ( ) ) ; $ date -> setTimezone ( $ timeZone ) ; $ this -> addStory ( strtotime ( $ date -> format ( 'Y-m-d H:i:s' ) ) , array ( 'name' => $ item -> from -> name , 'picture' => '//graph.facebook.com/' . $ item -> from -> id . '/picture?type=large' ) , isset ( $ item -> message ) ? $ item -> message : '' , array ( 'type' => isset ( $ item -> type ) ? $ item -> type : null , 'status_type' => isset ( $ item -> status_type ) ? $ item -> status_type : null , 'name' => isset ( $ item -> name ) ? $ item -> name : null , 'description' => isset ( $ item -> description ) ? $ item -> description : null , 'caption' => isset ( $ item -> caption ) ? $ item -> caption : null , 'link' => isset ( $ item -> link ) ? $ item -> link : null , 'full_picture' => isset ( $ item -> full_picture ) ? $ item -> full_picture : null ) ) ; if ( $ int == $ this -> args [ 'length' ] ) { break ; } } } }
Renders Facebook posts
@return void
Renders Facebook posts