From 25d3e97c231d50c45ce44168d8ebb0e24d10924a Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 27 Apr 2018 21:37:11 -0700 Subject: [PATCH] Fix passing args to start_output_buffering --- includes/class-amp-theme-support.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/class-amp-theme-support.php b/includes/class-amp-theme-support.php index 441fee9a4fd..a749ce484a4 100644 --- a/includes/class-amp-theme-support.php +++ b/includes/class-amp-theme-support.php @@ -261,7 +261,11 @@ public static function add_hooks() { * Start output buffering at very low priority for sake of plugins and themes that use template_redirect * instead of template_include. */ - add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), 0 ); + add_action( 'template_redirect', function() { + AMP_Theme_Support::start_output_buffering( array( + 'cancelable' => class_exists( 'WP_UnitTestCase' ), + ) ); + } ); // Commenting hooks. add_filter( 'wp_list_comments_args', array( __CLASS__, 'set_comments_walker' ), PHP_INT_MAX );