Skip to content

Instantly share code, notes, and snippets.

@pascalbajorat
Created June 14, 2019 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pascalbajorat/d232a7b5a0bfd4c852779d907e3e9be6 to your computer and use it in GitHub Desktop.
Save pascalbajorat/d232a7b5a0bfd4c852779d907e3e9be6 to your computer and use it in GitHub Desktop.
PB SEO Friendly Images Pro - Exclude filter
<?php
/* Place this in your functions */
function pbsfi_is_optimization_allowed($val) {
/*
* Use Conditional functions here to disable the plugin for specific posts or pages
* for example with is_page(12) for a page with ID 12:
* https://developer.wordpress.org/reference/functions/is_page/
*
* List of Conditional Tags: https://developer.wordpress.org/themes/basics/conditional-tags/
*/
if( is_page(12) ) {
add_filter('is_optimization_allowed', '__return_false');
}
}
add_function('wp_loaded', 'pbsfi_is_optimization_allowed');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment