Not working in what way? Error message?
Please post some code so I can see what you are doing.
Thread Starter
arbab
(@arbabhassan)
Here’s the code.
function pmy_postie_post_after($post) {
$post_id = $post['ID'];
// Set Status as 'Pending'
update_post_meta( $post_id, '_task_status', 'pending', '' );
// Set Pipeline as 'Reporting'
$terms = array('reporting');
wp_set_object_terms( $post_id, $terms, 'pipeline' );
}
add_action('postie_post_after', 'pmy_postie_post_after');
wp_set_object_terms is not working (not assigning term to the post) while update_post_meta is just working fine.
Not really a Postie issue, but I’d start with examining the results of wp_set_object_terms() it might be returning a WP_Error. See https://developer.ww.wp.xz.cn/reference/functions/wp_set_object_terms/