Skip to content

Instantly share code, notes, and snippets.

View erikmolenaarnl's full-sized avatar

Erik Molenaar erikmolenaarnl

View GitHub Profile
@erikmolenaarnl
erikmolenaarnl / gist:cf9d480efb8419d07fbb0bdf329418e6
Created November 15, 2024 13:36
Exclude Mediavine JS script from being optimized (e.g. minified, combined or deferred) by the SG Optimizer plugin
/**
* Exclude Mediavine JS script from being optimized (e.g. minified, combined or deferred) by the SG Optimizer plugin
*/
add_filter( 'sgo_js_minify_exclude', 'emd_exclude_mv_scripts_handles' );
add_filter( 'sgo_javascript_combine_exclude', 'emd_exclude_mv_scripts_handles' );
add_filter( 'sgo_js_async_exclude', 'emd_exclude_mv_scripts_handles' );
function emd_exclude_mv_scripts_handles( $exclude_list ) {
$exclude_list[] = 'mv-control-panel';
return $exclude_list;