Created
December 12, 2025 07:44
-
-
Save tonai126/4857bd330b2371ca0c589fbd942cbc23 to your computer and use it in GitHub Desktop.
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
| <?php | |
| /** | |
| * Add a custom point 8 to the Privacy Statement | |
| * Remove line 1 if implemented in functions.php instead of an mu-plugin | |
| */ | |
| function cmplz_edit_privacy_document_html($html, $region, $post_id) { | |
| // Only modify the Privacy Statement EU (not Cookie Policy) ------- PLEASE INSERT THE SLUG OF THE PRIVACY STATEMENT PAGE | |
| $post = get_post($post_id); | |
| if (!$post || $post->post_name !== 'privacy-statement-eu') { | |
| return $html; | |
| } | |
| // Your new point 8 | |
| $punto_8 = ' | |
| <h2>8. Trasferimento dati all\'estero</h2> | |
| <p>Non è previsto il trasferimento dei dati verso paesi terzi rispetto a quelli dell\'Unione Europea. Nel caso in cui ciò avvenga, nell\'ambito delle finalità connesse all\'espletamento del mandato professionale, si assicura la conformità alle disposizioni di legge applicabili (artt. 44 e ss. GDPR).</p> | |
| '; | |
| // Find the marker: end of section 7 and start of section 8 | |
| $marker = '</p><h2>8. Invio di un reclamo</h2>'; | |
| if (strpos($html, $marker) !== false) { | |
| // Insert the new point 8 before section 8 (Invio di un reclamo) | |
| $html = str_replace( | |
| $marker, | |
| '</p>' . $punto_8 . '<h2>8. Invio di un reclamo</h2>', | |
| $html | |
| ); | |
| // Renumber section 8 "Invio di un reclamo" to 9 | |
| $html = str_replace( | |
| '<h2>8. Invio di un reclamo</h2>', | |
| '<h2>9. Invio di un reclamo</h2>', | |
| $html | |
| ); | |
| // Renumber section 9 "Dettagli contatti" to 10 | |
| $html = str_replace( | |
| '<h2>9. Dettagli contatti</h2>', | |
| '<h2>10. Dettagli contatti</h2>', | |
| $html | |
| ); | |
| } | |
| return $html; | |
| } | |
| add_filter('cmplz_document_html', 'cmplz_edit_privacy_document_html', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment