Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add author name #140

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

nlemoine
Copy link
Contributor

@nlemoine nlemoine commented Sep 23, 2023

Except in #139 (which is probably a typo/mistake), Authorship doesn't make use of $term->name in authorship taxonomy. This might be a good idea to store the user display name as term name and keep them in sync.

This will intriduce some nice benefits almost without any tradefoffs (at least I couldn't see a case where names could be out of sync).

I'm first trying to push this to solve a problem I'm facing with Relevanssi but could apply to any indexing technology. Since Authorship only stores IDs in terms (in both name AND slug), It's quite hard to make it index the author (display) name. With $term->name storing author display name, just mark the authorship taxonomy as "to be indexed" and you're done. Searches containing author display names will now show up in your post search results, just like it does with Co-Authors-Plus.

It would also bring more performance to get_author_names avoiding the cost of querying user objects.

Side note: it would be nice to bump your dev dependencies and drop fixed constraints, it does not play well recent PHP versions (8/8.1). PHPStan for example evolved a lot since 0.12.57 and will raise more potential problems :)

- Update term name to user display name when creating terms
- Sync term name when user display name is updated
- Add tests
@nlemoine nlemoine force-pushed the feat-add-author-name branch from b104705 to 81852d8 Compare September 24, 2023 12:27
@nlemoine nlemoine marked this pull request as ready for review September 24, 2023 12:47
@nlemoine
Copy link
Contributor Author

nlemoine commented Feb 8, 2024

Friendly bump :)

I love the plugin but it really needs an update on various sides (react, php, etc.). I can contribute but need some maintainers review/merges 🙏

@johnbillion ?

@johnbillion
Copy link
Member

I'm hoping to be able to arrange some time for someone to work on Authorship soon

@roborourke
Copy link
Contributor

Would be a breaking change without #139, both the name and slug are the same currently. The change should be treated as breaking regardless I think so would make part of a 0.3.0 release rather than 0.2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants