thoughtis / cata-co-authors-plus

Common functions, configuration and compatibility fixes for Co-Authors Plus when used in Cata child themes. Not a fork or replacement for CAP.
GNU General Public License v3.0
0 stars 0 forks source link

Might not need `cata_cap_get_queried_coauthor` #37

Closed douglas-johnson closed 1 year ago

douglas-johnson commented 1 year ago

On author archives, the function cata_cap_get_queried_coauthor gets the coauthor by matching the query var author_name with the user_nicename value for the author.

However, user_nicename isn't always present for WordPress users.

get_queried_object seems to fulfill this taks in a more complete way, because WordPress users are found even if they don't have a nicename.

Are there any risks to using get_queried_object instead?

douglas-johnson commented 1 year ago

user_nicename isn't always present for WordPress users

This seems to happen with users who were created when importing posts. Saving the user restores their user_nicename.

Are there any risks to using get_queried_object instead?

I can't find any difference between the result of cata_cap_get_queried_coauthor and get_queried_object so it seems we could use the later instead.