Closed barryceelen closed 10 years ago
This is awesome! Definitely going in to the next version. The new shortcode needs to be documented in the readme, too.
Cool! I updated the readme files.
Crud, I thought I merged this already, sorry! Do we need to verify that the post format requested in the shortcode actually exists, or does that fail gracefully?
Also want to note for my own reference that this gets us partway to implementing #15. The only remaining piece would be a user setting for the default post type to use, if more than one post type exists.
Edit: Post types and post formats are different.
Crud, I thought I merged this already, sorry!
:-) No problem!
Does it work with custom post types, too?
Custom post types can be defined with support for post formats. As far as I can tell this is only relevant for showing the post format related interface elements.
Currently, if a post format shortcode is present in the email it will be set (if it is valid) even without the custom post type explicitly supporting it. Not sure if this is a good or a bad thing, really.
Once custom post type shortcode support is implemented we might want to check if the custom post type supports post formats via post_type_supports and act accordingly?
Do we need to verify that the post
typeformat requested in the shortcode actually exists, or does that fail gracefully?
If an invalid post format (or the ’standard’ post format) is passed to set_post_format()
via a shortcode, either no post format is set, or in case the particular post already has a post format, it is removed. The latter case will obviously not occur as the plugin only deals with post creation.
Also want to note for my own reference that this gets us partway to implementing #15.
I think you might have mixed up post formats with post types here :smile: I’ll gladly create another pull request for custom post type shortcode support once we have this one sorted (or just add it to this pull request?).
Whoops, you're right, I was going through all my support requests at once and confused myself. Gonna go ahead and merge this in. #15 is still a separate problem.
Yay!
Allows the user to define the post format via a shortcode , eg.
[post-format quote]
. If multiple formats are defined in the code, it will pick the first one.