Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active December 30, 2015 03:39
Show Gist options
  • Select an option

  • Save joshfeck/7770841 to your computer and use it in GitHub Desktop.

Select an option

Save joshfeck/7770841 to your computer and use it in GitHub Desktop.
This function will disable the NextGen gallery plugin's output buffering that breaks the Espresso API JSON feed. Add this to your theme's functions.php file or your own custom functionality plugin.
<?php
// Please do NOT include the opening php tag
/* Wrangle NextGen Gallery so it doesn't break the json API */
add_action( 'init','ee_nextgen_play_fair',1 );
function ee_nextgen_play_fair(){
if( preg_match( "/espresso-api/", $_SERVER['REQUEST_URI'] ) ){
add_filter( 'run_ngg_resource_manager','__return_false' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment