indieweb / wordpress-indieauth

IndieAuth for WordPress
https://wordpress.org/plugins/indieauth/
MIT License
29 stars 10 forks source link

Allow the user to set a default category for posts created by the application #28

Open aaronpk opened 6 years ago

aaronpk commented 6 years ago

A common feature request I hear from people using Wordpress with Micropub apps all the time is they want certain apps posts to appear in certain wordpress categories by default. For example, all posts from OwnYourGram should be added to the "Photos" category, all posts from OwnYourSwarm should be added to the "Checkins" category, but posts from Quill or Micro.blog should be "Uncategorized" or set to "Microblog". With the built-in authorization server, there is a great opportunity to have the wordpress plugin handle this now. It will take coordination with the Micropub plugin as well.

screenshot 2018-04-04 13 14 34

If the create scope is requested, then the authorization screen can provide an additional field for the user to select the default category for posts created by that application.

When the token is generated, the category ID can be stored in the database along with how it stores the token scope and all the other token info. Then the Micropub plugin can look at the token and if there is a category ID in the token, use that when creating the post.

Saving the value from this select box will be easier once #24 is fixed.

dshanske commented 6 years ago

I think that a filter would work well for this. Not sure everyone will want it. Will have thoughts

aaronpk commented 6 years ago

There's no harm in showing the dropdown if the default is the Wordpress default right? Won't all new posts go into the wordpress default category without this setting enabled?

dixonge commented 5 years ago

One more use case: default post for Indiepaper.io would be the bookmark post-kind. Or perhaps something more customized such as 'to-read' - I guess the key is for the approval process to query WordPress and see not only the default post types but also post-kinds, if enabled.

xavierroy commented 5 years ago

Adding another use case: Teacup entries could be mapped to a Food category which would map to either the eat or drink post kind in WP. Right now, I use a hashtag in the food context that gets mapped to a tag server-side.

dshanske commented 5 years ago

I fixed the mapping, just haven't released the fix