Add get_pdf_filename() to API#1558
Merged
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## development #1558 +/- ##
============================================
Coverage 76.07% 76.07%
============================================
Files 248 248
Lines 12993 12993
Branches 370 370
============================================
Hits 9885 9885
Misses 3100 3100
Partials 8 8 ☔ View full report in Codecov by Sentry. |
|
Coverage report for commit: 52ecb38 Summary - Lines: 92.96% | Methods: 88.24% | Branches: 81.37%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage report for commit: 52ecb38 Summary - Lines: 82.31% | Methods: 88.68%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the resolved PDF filename for an entry/PDF pairing, optionally with the .pdf extension. Returns WP_Error for invalid entry or PDF IDs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Description
Adds a new public API method,
GPDFAPI::get_pdf_filename(), for retrieving the generated filename of a PDF without having to render or fetch the document itself.Model_PDF::get_pdf_name()(which applies the configured filename merge tags)..pdfextension is omitted by default; passtrueas the third argument to include it.WP_Errorfor an invalid entry ID (invalid_entry) or an invalid/unknown PDF ID (invalid_pdf_setting).Testing instructions
Confirm the returned filename matches the name produced when the PDF is downloaded/viewed for that entry, and that the merge-tag-based filename settings are reflected.
Or run the PHPUnit coverage:
Screenshots
Checklist:
Additional Comments