wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Add tag selection to custom post type

wordpress snippet

Adding this wordpress snippet to the functions.php will enable tag selection within the editor for that custom post type. Don’t forget to change the CUSTOM_POST_TYPE to the name of the custom post type you created.

snippet :  PHPcopy
function reg_tag() {
	 register_taxonomy_for_object_type('post_tag', 'CUSTOM_POST_TYPE');
add_action('init', 'reg_tag');

Did you like this post? If so please share it with your friends. Thanks!