Conversation
|
Size Change: +299 B (+0.02%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
…edia-text-block-caption-support
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @bwoester, @fosterTerence, @Taruks, @AlternNO, @woodz-, @jennsuzhoy, @clarklab, @clo123, @SkipperPit, @alinekeller, @ToniSHernandez, @danwpc, @samrhein, @imsimplyellie, @gregoirenoyelle, @eriwm, @matthiasballreich, @random-pixels, @nicktrosnant, @cparkinson, @eilarva, @NolanDolce, @JohanVNR, @androos, @Fturttle. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks for working on this. I think this could do with design feedback (cc @WordPress/gutenberg-design). Some questions:
When adding media from Openverse, I believe the caption should be on by default to show the credit (I think it works this way for other media blocks already). The final thing is that theme.json caption element support will I think be needed for this, though I personally don't know much about it. |
|
Nice one. For the first iteration here, I'd make captions consistent with every other caption, such as those on video and image. It's close: But those other blocks come with a built in top and bottom margin, like so: We need something similar for media & text. Centering is something that a theme designer/developer should be able to do. Whether that happens through elements becoming stylable in global styles (I believe there's a separate issue tracking this), or the Caption becoming an innerblock (#54787). Though for now, I'd ensure consistency with other captions. |
|
Thank you for working on this @akasunil Sunil! |
It works for media-text blocks too. test-apatern-.-Pattern-.-gutenberg-.-Editor-.-WordPress.webm |
…edia-text-block-caption-support
…edia-text-block-caption-support
|
Flaky tests detected in b2b0f39. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12632784883
|
…edia-text-block-caption-support
|
Removing |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I think the hardest thing is whether to show the caption when the "Use featured image" is enabled.
In the current PR, if the "Use featured image" is enabled, the caption of the featured image will be automatically displayed. This means that there will be a visual change on the front end.
Do you have any good ideas on this?
It should be the same result as any other blocks that support featured image and caption. |
The only other block that supports featured image is the Cover block, but that block doesn't have a caption. Therefore, we need to consider a new ideal behavior for the Media & Text block. |
Can we use extra block attribute for this? |
carolinan
left a comment
There was a problem hiding this comment.
The caption position needs to be solved see the comment above.
| $image_tag = '<img class="wp-block-media-text__featured_image">'; | ||
| $caption = get_the_post_thumbnail_caption(); | ||
| $image_tag .= sprintf( | ||
| '<figcaption class="wp-element-caption">%1$s</figcaption>', |
There was a problem hiding this comment.
This should maybe use wp_theme_get_element_class_name( 'caption' )?



What?
Closes #14604
Why?
Caption support was missing for media in
Media & Textblock.How?
Added caption support for media in
Media & Textblock.Testing Instructions
Media & TextblockUse Featured Imageoption, and verify image caption.Screenshots or screencast