Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Tax_materia

Taxonomía de Materia

// Register Custom Taxonomy
function materia_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Otras materias', 'Taxonomy General Name', 'text_domain' ),
		'singular_name'              => _x( 'Otra materia', 'Taxonomy Singular Name', 'text_domain' ),
		'menu_name'                  => __( 'Materia', 'text_domain' ),
		'all_items'                  => __( 'Todas las materias', 'text_domain' ),
		'parent_item'                => __( 'Materia padre', 'text_domain' ),
		'parent_item_colon'          => __( 'Materia:', 'text_domain' ),
		'new_item_name'              => __( 'Nueva materia', 'text_domain' ),
		'add_new_item'               => __( 'Agregar nuevo materia', 'text_domain' ),
		'edit_item'                  => __( 'Editar', 'text_domain' ),
		'update_item'                => __( 'Actualizar', 'text_domain' ),
		'view_item'                  => __( 'Ver materia', 'text_domain' ),
		'separate_items_with_commas' => __( 'Separar con comas', 'text_domain' ),
		'add_or_remove_items'        => __( 'Agregar o Borrar', 'text_domain' ),
		'choose_from_most_used'      => __( 'Seleccionar más usados', 'text_domain' ),
		'popular_items'              => __( 'Populares', 'text_domain' ),
		'search_items'               => __( 'Buscar', 'text_domain' ),
		'not_found'                  => __( 'No encontrado', 'text_domain' ),
		'no_terms'                   => __( 'No existen items', 'text_domain' ),
		'items_list'                 => __( 'Lista de Items', 'text_domain' ),
		'items_list_navigation'      => __( 'Listado navegable de colaboradores', 'text_domain' ),
	);
	$rewrite = array(
		'slug'                       => '',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'rewrite'                    => $rewrite,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'materia', array( 'libro_post_type', ' fotografia_post_type', ' video_post_type' ), $args );

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