restaurante
if ( ! function_exists('crear_rest') ) {
// Register Custom Post Type
function crear_rest() {
$labels = array(
'name' => _x( 'Restaurantes', 'Post Type General Name', 'Restaurantes' ),
'singular_name' => _x( 'Restaurante', 'Post Type Singular Name', 'Restaurantes' ),
'menu_name' => __( 'Restaurantes', 'Restaurantes' ),
'name_admin_bar' => __( 'Restaurante', 'Restaurantes' ),
'archives' => __( 'Archivos de restaurante', 'Restaurantes' ),
'attributes' => __( 'Atributos de restaurante', 'Restaurantes' ),
'parent_item_colon' => __( 'Restaurante padre:', 'Restaurantes' ),
'all_items' => __( 'Todos los restaurantes', 'Restaurantes' ),
'add_new_item' => __( 'Añadir nuevo restaurante', 'Restaurantes' ),
'add_new' => __( 'Añadir nuevo', 'Restaurantes' ),
'new_item' => __( 'Nuevo restaurante', 'Restaurantes' ),
'edit_item' => __( 'Editar restaurante', 'Restaurantes' ),
'update_item' => __( 'Actualizar restaurante', 'Restaurantes' ),
'view_item' => __( 'Ver restaurante', 'Restaurantes' ),
'view_items' => __( 'Ver restaurantes', 'Restaurantes' ),
'search_items' => __( 'Buscar restaurante', 'Restaurantes' ),
'not_found' => __( 'Restaurante no encontrado', 'Restaurantes' ),
'not_found_in_trash' => __( 'No encontrado en la papelera', 'Restaurantes' ),
'featured_image' => __( 'Imagen principal', 'Restaurantes' ),
'set_featured_image' => __( 'Establecer imagen principal', 'Restaurantes' ),
'remove_featured_image' => __( 'Borrar imagen principal', 'Restaurantes' ),
'use_featured_image' => __( 'Usar como imagen principal', 'Restaurantes' ),
'insert_into_item' => __( 'Insertar al restaurante', 'Restaurantes' ),
'uploaded_to_this_item' => __( 'Subido a este restaurante', 'Restaurantes' ),
'items_list' => __( 'Lista de restaurantes', 'Restaurantes' ),
'items_list_navigation' => __( 'Lista de navegación de restauramentes', 'Restaurantes' ),
'filter_items_list' => __( 'Filtrar lista de restaurantes', 'Restaurantes' ),
);
$rewrite = array(
'slug' => 'restaurantes',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$capabilities = array(
'edit_post' => 'editar_restaurante',
'read_post' => 'leer_restaurante',
'delete_post' => 'borrar_restaurante',
'edit_posts' => 'editar_restaurantes',
'edit_others_posts' => 'editar_otros_restaurantes',
'publish_posts' => 'publicar_restaurante',
'read_private_posts' => 'leer_private_restaurante',
);
$args = array(
'label' => __( 'Restaurante', 'Restaurantes' ),
'description' => __( 'Creación de restaurante', 'Restaurantes' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'post-formats' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-carrot',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capabilities' => $capabilities,
);
register_post_type( 'restaurante', $args );
}
add_action( 'init', 'crear_rest', 0 );
}