It would be a nice-to-have. I figured it out once I took the time to read through your PHP. The requirement for the particular site that I’m working on is that one, and only one, category be displayed with each post on the home page and archive pages. Most posts will only be in one category, but a certain number will be in two and I wanted to have control over which one displayed.
Here’s what I ended up writing for my page:
$cat_id = get_post_meta( $post->ID , '_category_permalink', true );
if ( $cat_id != null ) {
$cat = get_category( $cat_id );
$category_link = get_category_link( $cat_id );
$category_name = $cat->name;
} else {
$cat = get_the_category();
$category_link = get_category_link( $category->term_id );
$category_name = $cat[0]->cat_name;
}
echo '<a href="'.$category_link.'">'.$category_name.'</a>';
I also changed the action word to “Primary” instead of “Permalink” because that makes more sense for the usage that we have.