<?php
namespace TourOperatorProBlock\block_recent_articles;
use TourOperatorPro\Factory as FactoryAlias;
use TourOperatorPro\Utilities\Utility as UtilityAlias;

/**
 * Class block_recent_articles_helper
 * @package TourOperatorProBlock\block_recent_articles
 */
class block_recent_articles_helper{
    /**
     * @return array|false
     */
    public static function getList_articles(){
        $args = array( 'numberposts' => '5', 'post_status'=>'publish' );
        $recent_posts = wp_get_recent_posts( $args );
       foreach ($recent_posts as &$item){
           $item=(object)$item;
           $item->image=get_the_post_thumbnail_url($item->ID);
       }
        return $recent_posts;
    }
}