Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Oferty

if ( ! function_exists('offers_post_type_function') ) {

// Register Custom Post Type
function offers_post_type_function() {

	$labels = array(
		'name'                => _x( 'Oferty', 'Post Type General Name', 'dziejesie' ),
		'singular_name'       => _x( 'Oferta', 'Post Type Singular Name', 'dziejesie' ),
		'menu_name'           => __( 'Oferty', 'dziejesie' ),
		'name_admin_bar'      => __( 'Oferty', 'dziejesie' ),
		'parent_item_colon'   => __( 'Oferty:', 'dziejesie' ),
		'all_items'           => __( 'Wszystkie Oferty', 'dziejesie' ),
		'add_new_item'        => __( 'Dodaj Ofertę', 'dziejesie' ),
		'add_new'             => __( 'Dodaj nową Ofertę', 'dziejesie' ),
		'new_item'            => __( 'Nowa Oferta', 'dziejesie' ),
		'edit_item'           => __( 'Edytuj Ofertę', 'dziejesie' ),
		'update_item'         => __( 'Aktualizuj', 'dziejesie' ),
		'view_item'           => __( 'Wyświetl Ofertę', 'dziejesie' ),
		'search_items'        => __( 'Szukaj Ofert', 'dziejesie' ),
		'not_found'           => __( 'Nic tu nie ma', 'dziejesie' ),
		'not_found_in_trash'  => __( 'Kosz pusty', 'dziejesie' ),
	);
	$rewrite = array(
		'slug'                => 'oferty',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$capabilities = array(
		'edit_post'           => 'edit_offer',
		'read_post'           => 'read_offer',
		'delete_post'         => 'delete_offer',
		'edit_posts'          => 'edit_offers',
		'edit_others_posts'   => 'edit_others_offers',
		'publish_posts'       => 'publish_offers',
		'read_private_posts'  => 'read_private_offers',
	);
	$args = array(
		'label'               => __( 'Oferta', 'dziejesie' ),
		'description'         => __( 'Oferty firm i organizacji', 'dziejesie' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => true,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-tag',
		'show_in_admin_bar'   => true,
		'show_in_nav_menus'   => false,
		'can_export'          => true,
		'has_archive'         => true,		
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capabilities'        => $capabilities,
	);
	register_post_type( 'offers', $args );

}
add_action( 'init', 'offers_post_type_function', 0 );

}