Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ejemplo de como podés crear un CPT con lo mínimo necesario para funcionar en tu web con WordPress.
<?php
/*
Plugin Name: Tu CPT's
Plugin URI: https://tuweb.com
Description: Plugin para crear CPT's
Version: 1.0.0
Author: Tu Nombre
Author URI: https://tuweb.com
License: GPL 2+
License URI: https://tuweb.com
*/
add_action( 'init', 'ejemplo_cpt' );
function ejemplo_cpt() {
register_post_type( 'ejemplo', array(
'label' => 'Ejemplo',
'public' => true,
'menu_icon' => 'dashicons-portfolio',
'has_archive' => true,
));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment