Repository navigation
Keep processing submitted rich text merge tags on sites upgraded to 6.18.0 - #1981
Merged
jakejackson1 merged 1 commit intoOct 28, 2026
Merged
Conversation
… to 6.18.0 6.18.0 stopped processing merge tags submitted in rich-text Textarea and Post Content fields. Sites upgrading from an earlier version keep the old behaviour, so the release isn't a breaking change for them; new installs leave the tags as text. The gfpdf_process_merge_tags_in_submitted_rich_text filter still overrides either default, and submitted PDF merge tags and shortcodes are still never signed. The 6.18.0 upgrade routine, now skipped on a new install, records gfpdf_process_submitted_rich_text_merge_tags with update_site_option(). On a Multisite that's the shared sitemeta table, so one upgrade covers every subsite, including network-activated ones whose admins can't activate plugins and so never run the routine. Upgrade routines only run when an admin who can activate plugins loads wp-admin, so until then PDFs show the tags as text. Uninstall removes the flag from the options table and sitemeta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gravitypdf-bot
force-pushed
the
fix/keep-rich-text-merge-tags-6.18.0
branch
from
October 28, 2026 00:44
8a2e0c4 to
4931bbd
Compare
6 tasks
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
6.18.0 stops processing merge tags that users submit in rich text Paragraph and Post Body fields. Those were the only fields that did, and some sites may rely on it. This PR keeps the old behaviour on sites upgrading from an earlier version, so the update doesn't break them. New installs show the tags as text.
gfpdf_process_merge_tags_in_submitted_rich_textcan still turn processing on or off on any site.gfpdf_process_submitted_rich_text_merge_tagsnetwork option. The 6.18.0 block is now skipped on a new install, which has no previous version.sitemeta). Once any site in the network upgrades, every subsite keeps processing.gfpdf_process_merge_tags_in_submitted_rich_textfilter.sitemetaon Multisite too.[gravitypdf]shortcodes are still never signed.Try it
{form_id}, then view its PDF. The form ID is shown.{form_id}is shown as text.add_filter( 'gfpdf_process_merge_tags_in_submitted_rich_text', '__return_true' );on the fresh install. The form ID is shown.Test plan
sitemeta.6.18.0to simulate the release:6.18.0-RC5to6.18.0saves it.6.18.0doesn't run the routine again.sitemeta, with no per-site rows.Model_Uninstall::remove_plugin_network_options()removes the flag fromsitemeta.Technical details
When the option is recorded: upgrade routines run from
gfpdf_version_changed. That hook fires fromController_Install::check_install_status(), which only runs when an admin withactivate_pluginsloads a wp-admin page. A site updated automatically or with WP-CLI shows submitted rich text merge tags as text until then.Why
sitemeta: on a network-activated Multisite, subsite admins usually can't activate plugins, so a subsite may never run the routine itself. With a network option, a single upgrade (normally a super admin on the main site) covers every subsite. On a single site,get_site_option()/update_site_option()use the options table.Fresh installs:
check_install_status()firesgfpdf_version_changedwithget_option( 'gfpdf_current_version' ), which isfalseon a new install and reachesmaybe_run_upgrade()as''. The 6.18.0 block requires$old_version !== ''. Its other two routines (fix_logged_out_timeout_out_of_range(),remove_nested_mpdf_cache()) did nothing on a new install anyway.Autoload:
update_site_option()on a single site callsupdate_option( ..., false ), so the row isn't autoloaded. On Multisite it lives insitemeta, which isn't autoloaded either. The option is only read inHelper_Abstract_Fields::process_value_tags(), which only runs when a rich text Paragraph or Post Body field is rendered for a PDF orGPDFAPI::get_form_data(). That costs at most one small query per such request, after which WordPress caches the value or the miss.