| Philipjohn21 added a comment. |
Hi! @Pigsonthewing asked for my feedback on this as I'm a WordPress developer, and I'm happy to help.
The proposal sounds good, and it'll be nice to get more metadata like this onto WordPress sites. I have one piece where I'd suggest the change would not make sense. The proposed change to make page titles use something like this:
<h1 class="page-title">Tag Archives: <a href="" data (Q309901)</a></h1>
My feeling is that many site owners would find that to be undesirable - taking people away from their site to a page that might not necessarily add more to their experience. The average user is unlikely to care much for that wikidata page :)
Otherwise, the approach sounds pretty good. I'd recommend the following;
- Include a field on the term edit screen (e.g. Posts > Tags > [Tag] > Edit). There is a term meta API for this in WordPress (see add_term_meta())
- Auto-add meta data on post save. To automate things a little, I'd suggest the following process happen whenever a post is saved;
- Each term attached to the post is retrieved and queried against the wikidata API
- If an exact match is found, the term meta for that term should be updated to add that term ID (if one isn't already present)
- This process could be problematic for performance, so I'd suggest the first step happen in a cron job to avoid making post saves horrendously slow
- The response from the wikidata API should also be cached for around 24 hours, to avoid unnecessary repetition.
- It should be possible to enable this for both categories and tags
- It should be possible for plugin and theme developers to enable this for their custom taxonomies. This can be done by passing an array of supported taxonomies through a custom apply_filters() hook.
- I don't think this plugin needs it's own settings page - the term meta API should provide all the UI we need, and anything more would add unnecessary complexity.
Please do code in the open and I'll be happy to provide some peer review as the project moves along.
Thanks!
Cc: Philipjohn21, Liuxinyu970226, Samwilson, Mbch331, Framawiki, DanBri, Esh77, Lydia_Pintscher, abian, Tramullas, Zeko, Aklapper, Pigsonthewing, Zppix, GoranSMilovanovic, QZanden, Psychoslave, Wikidata-bugs, aude
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
