Skip to content

Instantly share code, notes, and snippets.

@jandrodev
Created July 30, 2015 09:12

Revisions

  1. jandrodev created this gist Jul 30, 2015.
    25 changes: 25 additions & 0 deletions plugin.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    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' );