Neve heading typography (H1–H6 weight, size, line height) never carries over to Eduacademy

Offen Anfängerfreundlich
#29 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

Lies zuerst inc/Neve_Mods.php: AVAILABLE_TYPEFACE_CONTROLS (Zeile 34), die in_array()-Prüfung (Zeile 178) und den in Zeile 181 gebildeten Schlüssel. Korrigiere dann den Aufrufer in inc/Assets_Manager.php um Zeile 190, sodass er 'h1'…'h6' ohne den abschließenden Unterstrich übergibt, und korrigiere den Einstellungsschlüssel zu neve_h1_typeface_general, damit er zu Neves MODS_TYPEFACE_H1 passt. Überprüfe das mit den wp eval-Aufrufen im Issue, die nicht mehr ein leeres Array zurückgeben sollten, und indem du prüfst, dass der inline :root-Block --neve-font-weight-h1 ausgibt. Erweitere tests/test-assets-manager.php, sodass ein Überschriftenwert und nicht nur ein Body-Gewicht geprüft wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
Description

When a site switches from Neve to Eduacademy, Neve's heading typography (H1–H6 weight, size and line height) never carries over. Only the body typography does. Eduacademy's theme.json reads --neve-font-weight-h1, --neve-font-size-h2 and so on, but the theme never prints those variables, so headings always use Eduacademy's defaults.

There are two separate mistakes, and both would need fixing:

  1. inc/Assets_Manager.php line 190 builds the section name with a trailing underscore ('h1_'…'h6_') and passes it to Neve_Mods::get_neve_typeface_general(). That method only accepts names from AVAILABLE_TYPEFACE_CONTROLS ('', 'h1'…'h6', inc/Neve_Mods.php line 34), so in_array() (line 178) refuses every heading and returns an empty array.
  2. Even when called with 'h1', the method reads 'neve_' . $type_setting_name . 'typeface_general' (line 181), which is neve_h1typeface_general. Neve stores the setting as neve_h1_typeface_general (MODS_TYPEFACE_H1 in Neve's inc/core/settings/config.php), so it would still find nothing.

The body works only because its section name is the empty string: that gives neve_typeface_general, which is Neve's real key.

Step-by-step reproduction instructions
  1. On a site with Neve active, go to Appearance → Customize → Typography → Headings → H1. Set the weight to 800 and the size to 44px. 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: the inline :root{…} block contains --neve-font-weight-h1:800, --neve-font-size-h1:44px and the heading variables, and an H1 renders at weight 800 and 44px.
Actual: no --neve-font-*-h1 (or any H2–H6) variable is printed, and the H1 keeps Eduacademy's default weight (600) and size.

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

wp option update theme_mods_neve '{"neve_h1_typeface_general":{"fontWeight":"800","fontSize":{"desktop":44,"suffix":{"desktop":"px"}}}}' --format=json
wp eval 'var_export( Eduacademy\Neve_Mods::get_instance()->get_neve_typeface_general( "h1_" ) );'   # array ( )
wp eval 'var_export( Eduacademy\Neve_Mods::get_instance()->get_neve_typeface_general( "h1" ) );'    # array ( )
Screenshots, screen recording, code snippet or Help Scout ticket

Found while adding Eduacademy to the WordPress compatibility checks (Codeinwp/qa-compatibility#168). The new test in tests/test-assets-manager.php (#26) covers a body font weight, which is the one typography value that does carry over, so it passes. The same happens on every WordPress version tried (7.0.9, 7.1-RC1, 7.1.5).

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.