Repository navigation
fix(pdf): attach the PDF font script to super-common so optimizers keep it in order (6.4.x) - #261
Closed
RensTillmann wants to merge 1 commit into
Closed
RensTillmann wants to merge 1 commit into
RensTillmann wants to merge 1 commit into
Conversation
…ep it in order (6.4.x)
This was referenced Oct 20, 2026
Owner
Author
|
The fix is already released in 6.4.010 (release PR #299, merged 21 Oct 2026): add_pdf_font_script() is in src/includes/class-shortcodes.php (line 6913, called at line 6899), with escaped font URLs and one font per language per page on top. This PR's test file tests/test-pdf-font-inline-script.php was not part of that release and stays on this branch. The browser suite covers this on 6.4.010 (pdf-error-and-debug.spec.ts, passed). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Code part of #137 on 6.4. For non-Latin PDF languages the plugin printed
super_common_i18n.fonts = {link: ...}as a raw<script>onwp_footer(priority 100). If a JavaScript optimization plugin moves or delays the localizedsuper_common_i18n, that script throws a ReferenceError and the PDF loses its font.Now a small helper
add_pdf_font_script()attaches it withwp_add_inline_script( super-common, ..., after ), so it always runs right after the localized object; ifsuper-commonwas already printed (AJAX-loaded form / pending message), it falls back to the old footer output. The value is built withwp_json_encode. The font<style>output is unchanged.Base branch
release/6.4.x: bug fix for the beta channel. LTS counterpart: separate PR.Tests
Merge
Draft: for QA and the next 6.4.0xx release session.