moonorongo
12/22/2016 - 4:37 PM

[CPT Categories] Agregar una categoria a un custom post #cpt #acf #wordpress #php

[CPT Categories] Agregar una categoria a un custom post - EDITADO FROM CACHER #cpt #acf #wordpress #php

<?php

/* =============================================================================
   TAXONOMY
   ========================================================================== */

	$labels = array(
		'name'              => 'Brands',
		'singular_name'     => 'Brand',
		'search_items'      => 'Search Brands',
		'all_items'         => 'All Brands',
		'parent_item'       => 'Parent Brand',
		'parent_item_colon' => 'Parent Brand:',
		'edit_item'         => 'Edit Brand',
		'update_item'       => 'Update Brand',
		'add_new_item'      => 'Add New Brand',
		'new_item_name'     => 'New Brand Name',
		'menu_name'         => 'Brands'
	);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'brands' ), 
	);

// lo registra para el custom type 'campaign'
	register_taxonomy( 'brands', array( 'campaign' ), $args );