<?php

require_once plugin_dir_path(__FILE__) . 'veiculos/metabox.php';
require_once plugin_dir_path(__FILE__) . 'veiculos/query.php';
require_once plugin_dir_path(__FILE__) . 'veiculos/api.php';
require_once plugin_dir_path(__FILE__) . 'veiculos/util.php';
function alt_veiculos()
{
    $args_cursos_post_type = array(
        'labels' => array(
            'name' => 'Veículos',
            'all_items' => 'Todos os veículos',
            'add_new' => 'Adicionar novo veículo',
            'search_items' => 'Buscar veículo',
            'add_new_item' => 'Adicionar',
            'edit_item' => 'Editar'),
        'public' => true,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => ['slug' => 'veiculos', 'with_front' => true],
        //'rest_base'=>'',
        //'rest_controller_class'=>
        'supports' => ['title', 'editor', 'thumbnail'],
        'publicly_queryable' => true,
        'menu_icon' => 'dashicons-format-image',
        'supports' => array('title', 'editor', 'thumbnail'),
        'register_meta_box_cb' => '');
    register_post_type('veiculos', $args_cursos_post_type);

}

add_action('after_setup_theme', 'alt_enabled_featured_image');
function alt_enabled_featured_image()
{
    //add_post_type_support('veiculos', array('thumbnail', 'excerpt'));
    //add_theme_support('post-thumbnails', array('post', 'page', 'veiculos','marcas'));
    add_theme_support('post-thumbnails', array('veiculos'));
    // add_post_type_support('veiculos', array('author', 'excerpt','thumbnail'));
}

add_action('init', 'alt_veiculos');

