Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Multimedia CPT

if ( ! function_exists('multimedia_rv_cpt') ) {

// Register Custom Post Type
function multimedia_rv_cpt() {

	$labels = array(
		'name'                  => _x( 'Multimedia', 'Post Type General Name', 'multimedia_rv_cpt' ),
		'singular_name'         => _x( 'Multimedia', 'Post Type Singular Name', 'multimedia_rv_cpt' ),
		'menu_name'             => __( 'Multimedia', 'multimedia_rv_cpt' ),
		'name_admin_bar'        => __( 'Multimedia', 'multimedia_rv_cpt' ),
		'archives'              => __( 'Archivo Multimedia RV', 'multimedia_rv_cpt' ),
		'attributes'            => __( 'Item Attributes', 'multimedia_rv_cpt' ),
		'parent_item_colon'     => __( 'Multimedia:', 'multimedia_rv_cpt' ),
		'all_items'             => __( 'Todos los Multimedia', 'multimedia_rv_cpt' ),
		'add_new_item'          => __( 'Añadir nueva Multimedia', 'multimedia_rv_cpt' ),
		'add_new'               => __( 'Añadir nueva', 'multimedia_rv_cpt' ),
		'new_item'              => __( 'Nueva Multimedia', 'multimedia_rv_cpt' ),
		'edit_item'             => __( 'Editar Multimedia', 'multimedia_rv_cpt' ),
		'update_item'           => __( 'Actualizar Multimedia', 'multimedia_rv_cpt' ),
		'view_item'             => __( 'Ver Multimedia', 'multimedia_rv_cpt' ),
		'view_items'            => __( 'Ver Multimedia', 'multimedia_rv_cpt' ),
		'search_items'          => __( 'Buscar Multimedia', 'multimedia_rv_cpt' ),
		'not_found'             => __( 'No encontrada', 'multimedia_rv_cpt' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'multimedia_rv_cpt' ),
		'featured_image'        => __( 'Imagen destacada', 'multimedia_rv_cpt' ),
		'set_featured_image'    => __( 'Establecer imagen destacada', 'multimedia_rv_cpt' ),
		'remove_featured_image' => __( 'Remover imagen destacada', 'multimedia_rv_cpt' ),
		'use_featured_image'    => __( 'Usar como imagen destacada', 'multimedia_rv_cpt' ),
		'insert_into_item'      => __( 'Insertar en Multimedia', 'multimedia_rv_cpt' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'multimedia_rv_cpt' ),
		'items_list'            => __( 'Items list', 'multimedia_rv_cpt' ),
		'items_list_navigation' => __( 'Items list navigation', 'multimedia_rv_cpt' ),
		'filter_items_list'     => __( 'Filter items list', 'multimedia_rv_cpt' ),
	);
	$rewrite = array(
		'slug'                  => 'post_type',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Multimedia', 'multimedia_rv_cpt' ),
		'description'           => __( 'Multimedia RV', 'multimedia_rv_cpt' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-welcome-view-site',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'post',
	);
	register_post_type( 'multimedia', $args );

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

}