Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Opret Custom Post Type til produkter
function eid_cpt_produkt() {
$labels = array(
'name' => _x( 'Produkter', 'Post Type General Name', 'eid_domain' ),
'singular_name' => _x( 'Produkt', 'Post Type Singular Name', 'eid_domain' ),
'menu_name' => __( 'Produkter', 'eid_domain' ),
'parent_item_colon' => __( 'Produkt over:', 'eid_domain' ),
'all_items' => __( 'Alle produkter', 'eid_domain' ),
'view_item' => __( 'Vis produkt', 'eid_domain' ),
'add_new_item' => __( 'Tilføj produkt', 'eid_domain' ),
'add_new' => __( 'Tilføj nyt', 'eid_domain' ),
'edit_item' => __( 'Ret produkt', 'eid_domain' ),
'update_item' => __( 'Opdater produkt', 'eid_domain' ),
'search_items' => __( 'Søg produkt', 'eid_domain' ),
'not_found' => __( 'Ikke fundet', 'eid_domain' ),
'not_found_in_trash' => __( 'Ikke fundet i skraldespand', 'eid_domain' ),
);
$args = array(
'label' => __( 'produkt', 'eid_domain' ),
'description' => __( 'Produkter', 'eid_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'revisions', 'genesis-cpt-archives-settings' ),
//'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-portfolio',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'produkt', $args );
}
// Hook into the 'init' action
add_action( 'init', 'eid_cpt_produkt', 0 );
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.