-
Notifications
You must be signed in to change notification settings - Fork 7
Default to media library caption and omit caption attribute #77
Comments
I think the suggestion makes good sense. But this would be inconsistent with the core media experience. I think the current experience was designed for people familiar with the core media management flow - where a caption is set as text in the shortcode when the image is first sent to the the editor and then remains the same, whatever happens to the attachment post. We're not constrained by the same limitations here, so it would be possible to pull the caption field dynamically from the attachment post. It just requires a bit of thinking through to be unsurprising. In your suggestion, how would you indicate a selection of "no caption" - if the attachment in the media library has a caption set, but the post author doesn't want it to display with a caption in a specific post? |
Was going to make same point @goldenapples did about |
How about this:
If the default should be unchecked, for my use case we need to provide an option to switch the default to checked – what would be the best way to do this in a way consistent with the plugin? Would it be something like a filter with a callback that returns a boolean? Would it also make sense to extend this behavior to the I'll gladly put together a pull request if this proposal sounds good. |
+1 from me, I think this is an improvement over the existing handling. I believe the filtering we did in the PDF shortcode might help with your question about the specific use but let me know what you think: https://github.com/wp-shortcake/shortcake-bakery/blob/master/inc/shortcodes/class-pdf.php |
Okay great I'll put something together. |
You mean this? Yeah that makes sense. |
@montchr Exactly... lmk if you need any help with this, thanks! |
Current Behavior
When an image in the media library is given a caption and inserted into a post, the caption at that moment will be saved in the
caption
attribute of the shortcode. If the caption is later changed in the media library, the caption does not change in the post.This could be a significant issue especially in cases where an image was inserted into multiple posts and a factual error needs to be changed in the caption for all of those posts.
Suggested Behavior
When an attachment with a caption is added to a post, it should not have a
caption
attribute on the shortcode. That way the image caption in the post will be linked to the image caption as it exists in the media library.If the user wants to override the caption for a specific instance of the shortcode in a post, they should still be able to do so by either adding the
caption
attribute manually or editing the caption with the shortcode UI. At that point, the caption will be unique to that particular instance and will no longer be linked to the value of the caption in the media library until thecaption
attribute is removed.The text was updated successfully, but these errors were encountered: