Ju'Z[ed]
Forum Replies Created
-
Forum: Requests and Feedback
In reply to: Featured Image Resolution Options Missing in Patterns/Templatespouyawebio wrote:
This is actually expected behavior, not a bug.
The Featured Image block only exposes resolution controls when it has a post context (like inside a Query Loop). Outside of a Query block, WordPress treats it as a dynamic image without a specific post instance, so the size selector is intentionally hidden.
In other words:
- Inside Query Loop → post context exists → sizes available
- Outside Query → no fixed post → sizes removed
Workarounds:
- Wrap the Featured Image inside a Query Loop (even with 1 post)
- Use a normal Image block instead if you need fixed sizing
- Control dimensions via CSS (width/height/object-fit)
- Advanced: you can set sizes in theme.json or filter render_block_core/post-featured-image
So this is more of a design limitation of Gutenberg rather than a missing feature.Thank you for the detailed explanation. I now understand the design intent behind this behavior.
In my specific case, the pattern containing the Featured Image block is used within a custom Query Loop. Users can create their own patterns and assign them to each post type displayed in the query. However, even in this context, the resolution options remain unavailable for the Featured Image block when it’s placed inside a pattern—despite the pattern being used within a Query Loop.
I attempted to programmatically add post context using the
render_block_contextfilter, but it didn’t resolve my issue:add_filter('render_block_context', function ($context, $parsed_block) {
if ($parsed_block['blockName'] === 'core/post-featured-image') {
$context = [
'postId' => 1,
'postType' => 'post',
];
}
return $context;
}, PHP_INT_MAX, 2);Is there a way to ensure the Featured Image block recognizes the post context when used inside a pattern within a custom Query Loop? Alternatively, are there other filters, hooks, or methods to restore the resolution options in this scenario?
If this isn’t currently possible, are there plans to address this limitation in future WordPress updates? It would significantly enhance flexibility for developers and designers working with reusable patterns and custom Query Loops.
Thanks again for your help!
Erratum:
Adding the
--defaultsflag to thewp dbcommands ensure that the command reads your MySQL configuration.By default,
--no-defaultsis used inwp dbcommand, but I don’t know why this choice, it seems strange…- This reply was modified 6 months, 4 weeks ago by Ju'Z[ed].
Update on the issue:
The error was occurring during
wp db import db.sql, not during the search-and-replace step. The search-and-replace wasn’t working because the import itself was failing.What fixed it: Two things were critical:
- Adding the
--defaultsflag to thewp dbcommands:
wp db import db.sql --defaults- Disabling SSL in the MySQL configuration by adding:
[client]
ssl=0Removing this configuration caused the import to fail again, so it was also necessary.
Update on the issue:
The error was actually occurring during
wp db import db.sql, not during the search-and-replace step. The search-and-replace wasn’t working because the import itself was failing.What I tried:
- Globally disabled SSL in the MySQL config by adding:
[client]
ssl=0(Not sure if this had any effect, though.)
What likely fixed it:
Adding the
--defaultsflag to thewp dbcommands, like so:wp db import db.sql --defaultsThis ensures the command reads the credentials from
wp-config.php, whereas the default behavior (equivalent to--no-defaults) was causingmariadb-checkto fail during the import process.- This reply was modified 7 months ago by Ju'Z[ed].
Same issue here :
PHP Fatal error: Uncaught Error: Class “MailPoet\Models\CustomField” not found in /var/www/html/web/app/plugins/add-on-gravity-forms-mailpoet/add-on-gravity-forms-mailpoet.php:191
Everything is up to date