So, after all, it was a wordpress bug apparently…
The problem is I was registering the following year
taxonomy:
register_taxonomy('year', array('project'), array(
'hierarchical' => true,
'labels' => array('name' => 'Anos', 'singular_name' => 'Ano'),
'show_ui' => true,
'public' => false
));
And it seems year
is a reserved word for WP’s rewriting rules, and it must have gotten confused because of this. I simply renamed the taxonomy and updated the permalinks and everything started working again:
register_taxonomy('project-year', array('project'), array(
'hierarchical' => true,
'labels' => array('name' => 'Anos', 'singular_name' => 'Ano'),
'show_ui' => true,
'public' => false
));
I believe there must be other reserved names and the same problem might happen to register_post_type
function too.