Kirki_Helper::get_posts PHP Method

get_posts() public static method

Get an array of posts.
public static get_posts ( array $args ) : array
$args array Define arguments for the get_posts function.
return array
        public static function get_posts($args)
        {
            // Get the posts.
            $posts = get_posts($args);
            // Properly format the array.
            $items = array();
            foreach ($posts as $post) {
                $items[$post->ID] = $post->post_title;
            }
            return $items;
        }