%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/atv-api/wp-content/themes/atv/inc/controllers/
Upload File :
Create Path :
Current File : /var/www/html/atv-api/wp-content/themes/atv/inc/controllers/newsController.php

<?php 

class News {

    public function index($request)
    {

        $posts = getPosts('post');

        $postsArr = [];

        foreach($posts as $post) {
            $postsArr[] = [
                'title' => get_the_title($post->ID),
                'date' => get_the_date('F d, Y', $post->ID),
                'slug' => $post->post_name,
                'image' => get_the_post_thumbnail_url($post->ID)
            ];
        }

        return [
            'small_title' => get_field('small_title', 160),
            'title' => get_field('title', 160),
            'posts' => $postsArr
        ];

    }

}

Zerion Mini Shell 1.0