Try slapping a negative lookahead before the comment match, eg
function remove_html_comments($content="") {
return preg_replace('/(?!<!--\s*\/?mfunc\s*' . W3TC_DYNAMIC_SECURITY . ')<!--(.|\s)*?-->/', '', $content);
}
Related Posts:
- Correct regex for wp_embed_register_handler
- PHP Code stuck in Cache [Memcached] [closed]
- WordPress with php 5.5 and zend opcache
- Running code before object-cache.php runs
- customize wordpress database error page
- How do I disable cache for a certain page?
- Language does not switch while cache is enabled
- Splash pages on a high traffic site
- How do I change/modify the_post_thumbnail(); html output?
- Nginx FastCGI_Cache Vs PHP Caching
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- Correct way to make static pages editable in wordpress
- Multiple pages on one with different HTML
- Add custom HTML to posts page
- sql query to put quotes around numbers in img tag
- Minify HTML, CSS, JS with PHPWee?
- Header has extra HTML block at top before my code
- How to only show page id as body class?
- Shortcode content output but not in correct place
- How to properly insert a link to a template in WordPress?
- Show post in slider
- Add a class to the anchor tag on HTML5 gallery
- how to remove metadata from the posts of my blog?
- How to combine wordpress_logged_in cookies in one cookie?
- How to store data from multiple forms using ajax and php
- Use DOMDocument with ob_start breaks my HTML code
- selected option if current category is the value
- Input data from email form not going to JSON file
- Different post styles depending on category
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Show latest posts in a plain HTML website custom widget [closed]
- Is this spyware on my site or a real Java update?
- Search WordPress using static html page
- Hide HTML element (by class or ID) with PHP
- How to remove coupon dropdown feature
- Preg_Match(): compilation failed unknown property name
- Add html link in functions.php files of the theme
- preg_replace regex problem
- How to remove the h6 tag for the entry-category Class
- PHP contact form not redirecting [closed]
- How to Schedule Cronjobs for start of every month and year
- Handling PHP/HTML inside the output of a shortcode function
- Highlight the links without using dropdown
- Illegal string offset error in wordpress theme options textarea
- How to turn each phone number within the $content to a telephone link?
- Creating custom page template from existing PHP site
- Need help removing […] after excerpt
- Remove in post content
- Initial offset of number of posts in home page on the posts page
- Adding attribute to the post.php form tag in wp-admin
- WordPressUser Submission Form
- Shortcode displaying at the top of the page [duplicate]
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- Background image no longer fits to screen now that project is in php files
- How do I call a value from the datase using ajax
- Adding HTML Code to Replace Text in PHP
- Shortcode in Shortcode/HTML Graphics and Pictures
- I can’t go to the page archive-{post_type}.php
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- How to use wp_ajax_set_post_thumbnail?
- Passing a value from an input field to a php function in WordPress?
- Use Search Term in html link and redirect
- Comparison operator != not working in field [closed]
- Should I use wp_cache in my plugin to make it faster?
- HTML Formatting “single_term_title()”?
- Show subcategory name selected in specific category woocoommerce
- How to center all text body in single.php at once?
- Collapsible menu on post sidebar only expands and does not collapse
- How can I get my pagination loop to display the correct number of total pages?
- AMP version of e-commerce without plugin
- WordPress add_rewrite_rule
- Creating Log-In Page for backend server
- user update profile for custom code
- Vertical Menu for one page only
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Splitting table data to pages with numbers
- Show post/page into div using function
- wordpress, Category ID
- nested divs, classes for a grid in loop [duplicate]
- featured post as div background
- how to manipulate HTML parameters using PHP conditions
- Display wordpress post to static website in the footer
- Dynamically append custom post type to end of url
- Php echo into tag
- How to edit homepage in WordPress?
- Load Meta box value into div AJAX [duplicate]
- WP_Query not returning results
- How do I link the side images?
- Is there a better way to output HTML as a shortcode?
- How to create a container in php then customise it in CSS
- Add multiple HTML attributes to an Elementor button
- Is there a way to get wp_editor (tinymce) content?
- How to cut a section of a URL from a string with a regular expression?
- Saving meta box data from selected option’s value in database is not working
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- How can I improve and optimise my wordpress web server for better performance in 2023