Conversation
…ge. Refactor our image generation execution a bit to account for this
… clicked. This gives you the ability to add a prompt and generate an image. After the image is generated, you can start over or insert that image into the block, which will first import into the Media Library and optionally generate alt text
… type of block that was used to trigger the generation
…ate our types and add in styles
…unnecessary function
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #235 +/- ##
=============================================
+ Coverage 55.98% 56.02% +0.04%
- Complexity 509 511 +2
=============================================
Files 32 32
Lines 2608 2622 +14
=============================================
+ Hits 1460 1469 +9
- Misses 1148 1153 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…button. Tie this into the same modal. Fix params when inserting as a cover block
…rror when new actions are performed. Minor style adjustments
|
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: @prabinjha, @kurtrank. 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. |
If that's not ready in time for us to merge/release on this PR, then let's update the context in #236 to include that perhaps? Testing feedback...
|
… generated image, make sure we push the user into the typical Gallery Media Library flow
…eady adds this. Change the component we use depending on the context we are in so the button renders properly in both the default state and the toolbar state
…ing the same prompt
…y generated image
Similar to #252, this particular section only shows if you're using the Gutenberg plugin (or on WP 7.0-beta1). That said, I realized the
Seems this is the same thing that is rendering in that new sidebar section so I've updated our code to handle this so this should look correct there now. I've also removed the custom toolbar button I was adding as there's no need for two buttons there.
Updated
Updated
Updated
Added this
Updated
Updated
I was trying to match the same flow you get if you use the Upload button in the gallery block (or drag an image into the block). In that case, it renders the inner image block immediately (same as what we're doing here). I do like the user experience of pushing them to that media modal so I've attempted to simulate that now (noting this all uses the media library modal code that isn't super easy to extend so may still have some rough edges).
I think the answer is yes though I'd suggest that's a separate PR as all the code here is scoped to the block editor and so we'll need a different approach to support anything outside of that |
Looking into this more, seems changes will be needed both in the PHP AI Client and in each provider implementation, so I don't think this will be done prior to this PR being ready. I'll likely remove all of the edit/refine image work from this PR but I'll wait until we can discuss that. |
I created #254 for that follow-up work. |
jeffpaul
left a comment
There was a problem hiding this comment.
Looking into this more, seems changes will be needed both in the PHP AI Client and in each provider implementation, so I don't think this will be done prior to this PR being ready. I'll likely remove all of the edit/refine image work from this PR but I'll wait until we can discuss that.
@dkotter feel free to remove that and then merge, everything else here looks great!
All the image editing/refinement code has been removed now. Was hoping to be able to leave that and get that working upstream but don't want to block this PR any longer. For future reference (when we hopefully can add this back) here's the commit that removed all of that: 68c6450 |
jeffpaul
left a comment
There was a problem hiding this comment.
Tested and all works as expected, nice work!
|
re-running Plugin Check and WP latest test checks... |





What?
Closes #13
Adds the ability to generate images inline instead of just within the featured image section.
Why?
In #134 and #146 we added support for generating images in the featured image section. All the functionality exists to generate images elsewhere so this PR brings that into the block editor, within core blocks that support images (like
core/image,core/cover).How?
editor.MediaUploadand add our custom button into the block toolbar / block media controls for image blocksUse of AI Tools
Approach was planned using Claude Code running Sonnet 4.6. Claude Code than executed that plan with me reviewing and testing along the way. I finished the last bits and pieces myself
Testing Instructions
Settings > AI Credentials. Note only Google and OpenAI support image generationSettings > AI ExperimentsGenerate Imagebutton next to the other media buttonsScreenshots or screencast