Skip to content

Commit 2b1bd18

Browse files
committed
Prevent finishing initialization if not on frontend
1 parent 1d1e05f commit 2b1bd18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

includes/class-amp-theme-support.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ public static function init() {
153153
* the response at this action and then short-circuit with exit. So this is why the the preceding
154154
* action to template_redirect--the wp action--is used instead.
155155
*/
156-
add_action( 'wp', array( __CLASS__, 'finish_init' ), PHP_INT_MAX );
156+
if ( ! is_admin() ) {
157+
add_action( 'wp', array( __CLASS__, 'finish_init' ), PHP_INT_MAX );
158+
}
157159
}
158160

159161
/**

0 commit comments

Comments
 (0)