Blender-org web-assets v2 upgrade #104116
@ -30,6 +30,13 @@ if( !empty($block['align']) ) {
|
||||
$className .= ' float-' . $block['align'];
|
||||
}
|
||||
|
||||
// Remove class "cards" from $className to apply "cards" on child wrapping element only.
|
||||
|
||||
// Check if $className contains "cards".
|
||||
if (str_contains($className, "cards")) {
|
||||
// Remove the substring "cards".
|
||||
$className = str_replace("cards", "", $className);
|
||||
}
|
||||
|
||||
// Load values and assign defaults.
|
||||
$card_layout = get_field('card_layout');
|
||||
$cards_aspect_ratio = get_field('card_aspect_ratio');
|
||||
|
Loading…
Reference in New Issue
Block a user
This whole section is about removing "cards" from $className. This gets added in line 15, you could also go there and rename it or not add it in the first place.
The
$className
is used to render various classes on the parent element within thecards
template based on Gutenberg editor settings. I'm not sure we can test all possibilities, but rendering$className
on the parent's class attribute seems important to keep. I think removing line 15$className = $className[1];
would break it, as the latter converts the array to an actual string.cards is a reserved classname in BWA v2, and mustn't be present on the outer wrapper element that is needed here. Based on these, I think the substring replacement is needed for not to accidentally break some other settings I'm not aware of. 🤔