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 to change redirection route to a php page for making it only accessible by logged-in members?
- selected option if current category is the value
- Passing UTM Parameters To Modify Page In WordPress
- WordPress & Fastcgi proper setup?
- Dynamic content in template
- How to remove ?wp-mce-4103-20162941
- Customize position of social icons in upme plugin [closed]
- Why Won’t My Inputs in a form with a Get method work together?
- Extend PHP regex to cover “srcset” and “style” attributes
- parts of url disappear when using # inside href=”” [closed]
- Settings API callback function inserts html quotes from nowhere
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Dot is not added at the end of href
- WordPress Multiple Navigation bars
- Position banner to right of logo in header – messed up my header file
- Commenting out unwated CSS/scripts in HTML with PHP
- How to separate HTML and WordPress files
- Add .htm extention to a custom taxonomy
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Make PHP work with HTML tags
- how to remove colon and white space in a string by php
- Get URL from shortcode tag
- Noscript not working as it should in wordpress site
- Show latest posts in a plain HTML website custom widget [closed]
- How to convert select to HTML with PHP tags inside of it [closed]
- get_users meta_query: REGEXP not working for matching new lines
- Is this spyware on my site or a real Java update?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- Is the wp_enqueue method efficient?
- How to make modifications only to certain elements of an HTML string on the server-side?
- Wrapping a Sidebar within
- Search WordPress using static html page
- Hide HTML element (by class or ID) with PHP
- Add Codepen animation as Preloader to WordPress
- Path for php file for inserting data through html form
- Function returns text instead of html [closed]
- Printing HTML codes
- Widget back end radio button issue
- HTML escaping data with ajax requests
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrieve the data from the sever and displaying it in a page?
- php within html within php
- How to execute html code inside php?
- How to remove coupon dropdown feature
- Add data-id attribute to child page links
- Preg_Match(): compilation failed unknown property name
- Add shortcode in my div
- WordPress plug-in for dynamic download link?
- HTML table attributes ignored
- php esc_html_e with an html link inside not working
- Add html link in functions.php files of the theme
- Using ob_start and ob_get_clean with wordpress shortcode
- How to edit HTML of my website on WordPress? [closed]
- WordPress wp-admin redirect and exception
- preg_replace regex problem
- How to remove the h6 tag for the entry-category Class
- Override user-edit.php to design own profile page
- wp_insert_post() with HTML tags using PHP
- How to rename woocommerce-billing-fields
- Prevent redirect to wp-login.php
- PHP contact form not redirecting [closed]
- Creating an image from a custom field
- How to add no follow to specific links?
- WordPress transient not working with WP Engine
- How to Schedule Cronjobs for start of every month and year
- Where can I find the inline-css of my theme header?
- php preg_match with multiple patterns
- Handling PHP/HTML inside the output of a shortcode function
- Make textarea required. Help [closed]
- Extract links from content
- WordPress forms submissions and PHP files
- Menu Custom Data Attributes
- How to add post meta in while loop?
- Adding function to child theme’s function.php
- 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
- wordpress site – using custom database and PHP
- How to use the checked() function to check for a non-empty var
- Calling function in loop causes repeat data
- Remove   from the_excerpt
- How do I access post_meta key with php?
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- How to exclude a widget from W3 Total Cache Plugin
- Separate array output into a