Permalink
Browse files

Allow the action into which AO hooks to be changed using a defined co…

…nstant.
  • Loading branch information...
1 parent 1386e4f commit ed2a1f4ee1610e602d4e73fccf2de7cebaeaeeee @futtta committed Dec 18, 2016
Showing with 2 additions and 1 deletion.
  1. +2 −1 autoptimize.php
View
@@ -286,7 +286,8 @@ function autoptimize_end_buffering($content) {
if (defined('AUTOPTIMIZE_INIT_EARLIER')) {
add_action('init','autoptimize_start_buffering',-1);
} else {
- add_action('template_redirect','autoptimize_start_buffering',2);
+ if (!defined('AUTOPTIMIZE_HOOK_INTO')) { define('AUTOPTIMIZE_HOOK_INTO', 'template_redirect'); }
+ add_action(constant("AUTOPTIMIZE_HOOK_INTO"),'autoptimize_start_buffering',2);
}
}
} else {

0 comments on commit ed2a1f4

Please sign in to comment.