@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio-doc&#038;p=154598>
  a sioc:Post ;
  dc:title "How it works" ;
  dcterms:identifier 154598 ;
  dc:modified "2026-11-14T16:45:26Z"^^xsd:dateTime ;
  dc:created "2026-11-14T15:28:18Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-persistent-forms/how-it-works/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-persistent-forms/">LH Persistent Forms</a></li></ul>
<p class="wp-block-paragraph">On the front end the plugin loads one small script module, which waits until the browser is idle. Values are kept only in the visitor&#8217;s own browser, in IndexedDB through the shared <code>idb-keyval</code> module. Nothing is sent to the server.</p>



<h3 class="wp-block-heading">Per-page fields</h3>



<p class="wp-block-paragraph">Fields matching the local selectors (by default <code>#comment</code>) are saved as the visitor types, keyed by the page URL without its fragment and by the field&#8217;s ID, so they need an ID. If the visitor comes back to the same page before submitting, the text is put back. Submitting the form clears it.</p>



<h3 class="wp-block-heading">Site-wide fields</h3>



<p class="wp-block-paragraph">Fields matching the global selectors (by default <code>input[type="email"]</code> and <code>input[autocomplete="name"]</code>) are saved when they change, keyed by the selector, and filled in on any page of the site where a matching field is empty. They&#8217;re kept after submitting. If a field matches both lists, it is treated as site-wide.</p>



<p class="wp-block-paragraph">A saved value only fills an empty field. Passwords, hidden fields, files, checkboxes, radio buttons and buttons are never stored, and only fields inside a form are handled.</p>



<h3 class="wp-block-heading">Filters</h3>



<ul class="wp-block-list">
<li><code>lh_persistent_forms_return_local_selectors</code>: array of CSS selectors for per-page fields.</li>



<li><code>lh_persistent_forms_return_global_selectors</code>: array of CSS selectors for site-wide fields.</li>



<li><code>lh_persistent_forms_should_load</code>: whether to enqueue the module on this request (front end only by default).</li>



<li><code>lh_persistent_forms_init_plugin</code>: return false to switch the plugin off without deactivating it.</li>
</ul>



<h3 class="wp-block-heading">The idb-keyval library</h3>



<p class="wp-block-paragraph">The module imports <code>idb-keyval</code>. When LH idb-keyval is active, every plugin shares its copy. Otherwise the plugin registers its own bundled idb-keyval 6.3.0, and Site Health and the Plugins screen say so. Requires WordPress 6.7 or later, for script module data.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Persistent Forms
On the front end the plugin loads one small script module, which waits until the browser is idle. Values are kept only in the visitor&#8217;s own browser, in IndexedDB through the shared idb-keyval module. Nothing is sent to the server.



Per-page fields



Fields matching the local selectors (by default #comment) are saved as the visitor types, keyed by the page URL without its fragment and by the field&#8217;s ID, so they need an ID. If the visitor comes back to the same page before submitting, the text is put back. Submitting the form clears it.



Site-wide fields



Fields matching the global selectors (by default input[type="email"] and input[autocomplete="name"]) are saved when they change, keyed by the selector, and filled in on any page of the site where a matching field is empty. They&#8217;re kept after submitting. If a field matches both lists, it is treated as site-wide.



A saved value only fills an empty field. Passwords, hidden fields, files, checkboxes, radio buttons and buttons are never stored, and only fields inside a form are handled.



Filters




lh_persistent_forms_return_local_selectors: array of CSS selectors for per-page fields.



lh_persistent_forms_return_global_selectors: array of CSS selectors for site-wide fields.



lh_persistent_forms_should_load: whether to enqueue the module on this request (front end only by default).



lh_persistent_forms_init_plugin: return false to switch the plugin off without deactivating it.




The idb-keyval library



The module imports idb-keyval. When LH idb-keyval is active, every plugin shares its copy. Otherwise the plugin registers its own bundled idb-keyval 6.3.0, and Site Health and the Plugins screen say so. Requires WordPress 6.7 or later, for script module data.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1>, <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261114t043500-how-it-works> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261114t043500-how-it-works> rdfs:seeAlso <https://lhero.org/?taxonomy=lh_object_key&term=lh-portfolio_doc_20261114t043500-how-it-works&feed=lhrdf&format=turtle> .
