Heading font set in Neve is replaced by the body font after switching to Eduacademy

Offen Anfängerfreundlich
#28 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
php, wordpress
Bereich
frontend

Rechercherichtung

Beginne in inc/Assets_Manager.php bei get_css_font_vars() im Bereich der Zeilen 174-179, wo die Neve-Überschriften-Schriftart gelesen und dann von der Textkörperschriftart überschrieben wird, bevor die Überschriftenprüfung ausgeführt wird. Lies die umgebenden Optionsabfragen, um zu sehen, wie der gespeicherte Wert von neve_headings_font_family abgerufen wird, und mache die Textkörperschriftart dann nur dann zum Fallback, wenn keine Überschriften-Schriftart vorhanden ist. Fertig sieht so aus, dass wp eval 'echo Eduacademy\Assets_Manager::get_inherited_style_values();' --neve-font-family-heading:Fraunces zusammen mit der Outfit-Textkörperschriftart für die geseedete Option theme_mods_neve ausgibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
Description

When a site switches from Neve to Eduacademy, Eduacademy is meant to keep Neve's fonts. The body font carries over, but the heading font doesn't: headings use the body font instead of the heading font chosen in Neve.

In inc/Assets_Manager.php, get_css_font_vars() reads Neve's heading font (line 174). Then, when a body font is set, it overwrites that value with the body font (line 179):

$neve_headings_font = $neve_body_font; // If the body font is set, the headings font should be the same until we check if the headings font is set.

The check that follows reads that overwritten variable, so the heading font Neve stored is never used. The comment describes the intent (body font as a fallback), but the code replaces the stored value rather than falling back to it.

Step-by-step reproduction instructions
  1. On a site with Neve active, go to Appearance → Customize → Typography. Set the body font to Outfit and the headings font to Fraunces (both are in Eduacademy's font list). Publish.
  2. Switch the theme to Eduacademy 1.0.1.
  3. Open any page and view the page source. Find the theme's inline style (eduacademy-style-inline-css).

Expected: --neve-font-family-body:Outfit;--neve-font-family-heading:Fraunces, with headings rendered in Fraunces.
Actual: --neve-font-family-body:Outfit;--neve-font-family-heading:Outfit, with headings rendered in Outfit.

Without Neve installed, the same result comes from setting the option directly:

wp option update theme_mods_neve '{"neve_body_font_family":"Outfit","neve_headings_font_family":"Fraunces"}' --format=json
Screenshots, screen recording, code snippet or Help Scout ticket

Found while adding Eduacademy to the WordPress compatibility checks (Codeinwp/qa-compatibility#168). The output above was read on a seeded test site with wp eval 'echo Eduacademy\Assets_Manager::get_inherited_style_values();'. The same happens on every WordPress version tried (7.0.9, 7.1-RC1, 7.1.5), so it is not a WordPress compatibility problem.

Environment info

Eduacademy 1.0.1 (built from the v1.0.1 tag), WordPress 7.0.9 / 7.1-RC1 / 7.1.5, PHP 8.3, wp-env.

Is the issue you are reporting a regression

No

Vorherrschende Sprache
PHP
Sterne
0
Forks
0
Ø Merge
22 Std. 12 Min.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Codeinwp/eduacademy

Alle Issues in Codeinwp/eduacademy

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.