Preserve specific text / html block within outputted code

Posted in: Getting Started (4) How To (14) Plugin Options Explained (35) Actions / Filters (30)      Html Content (5)    Replace (10)    Code Example (15)  

This functionality is available for PRO version.

The WordPress WP Hide & Security Enhancer PRO achieve provided functionality through internal filters and rewrite code. This ensure a perfect compatibility is maintained across the site without requiring to change anything at the code level or to any of WordPress files/folders structure. Any updating functionality for wither WordPress plugins/themes or custom code is preserved and it will run the same as before.

Generally, the plugin do the replacements at the end of WordPress core code execution, it will replace any occurrence of specific urls and paths with new ones which are being translated through rewrite code. In some situations, specific links, texts and html blocks are required to stay as is. To achieve that, there’s an easy approach, the specified blocks need to be wrapped up in a specific HTML comment tags:

<!– WPH Preserve – Start –>
block to preserve
<!– WPH Preserve – Stop –>

The following example preserve the content as is for a textarea field. Any matching urls and texts which will match the textarea content will not be replaced.

<!-- WPH Preserve - Start --> 

<p><textarea id="export_settings" class="code" readonly="readonly" rows="12">This is a preserved URL</textarea></p>

<!-- WPH Preserve - Stop -->
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top