Created
July 30, 2015 09:12
-
-
Save jandrodev/bc135f5f11b2f99537b2 to your computer and use it in GitHub Desktop.
Basic Wordpress Post Type Creation
This file contains hidden or 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
function create_post_type_eventos() { | |
register_post_type( 'eventos', | |
array( | |
'labels' => array( | |
'name' => __( 'Eventos' ), | |
'singular_name' => __( 'Eventos' ), | |
'all_items' => __('Todos los eventos'), | |
), | |
'public' => true, | |
'has_archive' => true, | |
'rewrite' => true, | |
'menu_icon' => 'dashicons-calendar', | |
'menu_position' => 6, | |
'supports' => array( 'title', 'excerpt', 'editor', 'thumbnail' ) | |
) | |
); | |
$set = get_option('post_type_rules_flased_eventos'); | |
if ($set !== true){ | |
flush_rewrite_rules(false); | |
update_option('post_type_rules_flased_eventos',true); | |
} | |
} | |
add_action( 'init', 'create_post_type_eventos' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dashicons Wordpress : https://developer.wordpress.org/resource/dashicons