﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
17336	Can't use get_the_terms() within a function that hooks into publish_post	defunctlife		"I've tried everything, but get_the_terms() always returns false. When using a similar function on the actual single.php page it works fine. I have confirmed the correct post id's are being returned within the dashboard. I have also confirmed that indeed these posts have a taxonomy item of myshift_title from within the dashboard. I tried wp_get_object_terms() but it returns an empty array. 

From what I can tell I just can access a post's taxonomy, and I would really like to.

From my functions.php

{{{
function shift_add_progress_report_notification($post_ID) {		

	/* Register the taxonomy as we don't seem to have access to it here */	
	register_taxonomy('myshift_title', array('myshift', 'post'), array('label' => 'My Shift Title', 'rewrite' => false, 'query_var' => true));

	$terms = get_the_terms( $post_ID, 'myshift_title');

	ob_start();
	var_dump($terms);
	$a = ob_get_contents();
	ob_end_clean();
	
	mail('xxxxxxx', 'Progress Report', $a . ' POST ID: ' . $post_ID);
}
add_action( 'publish_post', 'shift_add_progress_report_notification', 10, 1);
}}}

"	defect (bug)	closed	normal		Taxonomy	3.1	normal	invalid		
