Skip to content

Instantly share code, notes, and snippets.

@GDmac
Created June 22, 2014 08:55
Show Gist options
  • Save GDmac/dae6bcce24b1c42d7fa1 to your computer and use it in GitHub Desktop.
Save GDmac/dae6bcce24b1c42d7fa1 to your computer and use it in GitHub Desktop.
Debug Override plugin, disable ExpressionEngine template debugging from a template
<?php
$plugin_info = array(
'pi_name' => 'debug_override',
'pi_version' =>'1.0',
'pi_author' =>'GDmac',
'pi_author_url' => '',
'pi_description' => '',
'pi_usage' => '{exp:debug_override override="all|ajax"} default is override on ajax calls',
);
class debug_override {
public function __construct()
{
$this->EE =& get_instance();
$override = $this->EE->TMPL->fetch_param('override', 'ajax');
// no debugging or output-profiler for ajax
if( ($override=='all') || ($override=='ajax' && AJAX_REQUEST))
{
$this->EE->TMPL->debugging = FALSE;
$this->EE->output->enable_profiler(FALSE);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment