Last active
January 10, 2020 00:46
-
-
Save alexavalossv/4b72ebd234c877d58fb8c25410202bcd to your computer and use it in GitHub Desktop.
Ejemplo de como podés crear un CPT con lo mínimo necesario para funcionar en tu web con WordPress.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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