Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez DavidPeralvarez/plugin-cpt.php Secret
Created Jun 12, 2018

What would you like to do?
La función register_post_type y los "labels"
Plugin Name: Plugin CPT y Custom Taxonomies
Plugin URI:
Description: Plugin para aprender a crear CPT y CT con código
Version: 1.0.0
Author: David Perálvarez
Author URI:
License: GPL2
License URI:
Plugin CPT y Custom Taxonomies is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
Plugin CPT y Custom Taxonomies is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Plugin CPT y Custom Taxonomies. If not, see
// Comic Reviews
function comic_review_setup_post_type(){
$labels = array(
'name' => __( 'Reseñas', 'scv' ),
'singular_name' => __( 'Reseña', 'scv' ),
'add_new' => __( 'Añadir reseña', 'scv' ),
'add_new_item' => __( 'Añadir nueva reseña', 'scv' ),
'edit_item' => __( 'Editar reseña', 'scv' ),
'new_item' => __( 'Nueva reseña', 'scv' ),
'view_item' => __( 'Ver reseña', 'scv' ),
'view_items' => __( 'Ver reseñas', 'scv' ),
'search_items' => __( 'Buscar reseñas', 'scv' ),
'not_found' => __( 'No se encontraron reseñas', 'scv' ),
'not_found_in_trash' => __( 'Ninguna reseña encontrada en la papelera', 'scv' ),
'all_items' => __( 'Todas las reseñas', 'scv' ),
'insert_into_item' => __( 'Insertar en la reseña', 'scv' ),
//'menu_name' => __( 'Reseñas de cómics', 'scv' ),
'filter_items_list' => __( 'Lista de reseñas filtrada', 'scv' ),
'items_list_navigation' => __( 'Navegación por el listado de reseñas', 'scv' ),
'items_list' => __( 'Lista de reseñas', 'scv' ),
$args = array(
'public' => true,
'labels' => $labels,
// poner prefijo, max 20
register_post_type( 'scv_comic_review', $args );
add_action( 'init', 'comic_review_setup_post_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.