Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions integrations/bricks/includes/class-fonts-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ public function get_fonts( WP_REST_Request $request ) {
if ( ! is_array( $font ) ) {
continue;
}
// Bricks stores the CSS font-family name in 'font_family';
// fall back to 'family' or 'title' for schema variants.
$family = $font['font_family'] ?? $font['family'] ?? null;
// Bricks schema variants across versions:
// font_family — explicit CSS family name (most reliable)
// family — alternative key used in some versions
// title — display name; doubles as the CSS family name
// for fonts downloaded via Bricks' local-Google-
// Fonts feature (no separate font_family key).
$family = $font['font_family'] ?? $font['family'] ?? $font['title'] ?? $font['name'] ?? null;
$label = $font['title'] ?? $font['name'] ?? $family;
if ( ! $family || ! is_string( $family ) ) {
continue;
Expand All @@ -86,9 +90,9 @@ public function get_fonts( WP_REST_Request $request ) {
if ( ! is_array( $font ) ) {
continue;
}
// Bricks stores the family name in 'family'; 'name' is a
// display label used in older schema versions.
$family = $font['family'] ?? $font['name'] ?? null;
// Bricks stores the family name in 'family'; 'name' and
// 'title' are display labels used in schema variants.
$family = $font['family'] ?? $font['font_family'] ?? $font['name'] ?? $font['title'] ?? null;
if ( ! $family || ! is_string( $family ) ) {
continue;
}
Expand Down