diff options
Diffstat (limited to 'plugins/jetpack/modules/masterbar.php')
-rw-r--r-- | plugins/jetpack/modules/masterbar.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/masterbar.php b/plugins/jetpack/modules/masterbar.php index 6672a992..8efeae3e 100644 --- a/plugins/jetpack/modules/masterbar.php +++ b/plugins/jetpack/modules/masterbar.php @@ -11,6 +11,16 @@ * Additional Search Queries: adminbar, masterbar */ -include dirname( __FILE__ ) . '/masterbar/masterbar.php'; +require dirname( __FILE__ ) . '/masterbar/masterbar.php'; -new A8C_WPCOM_Masterbar; +// In order to be able to tell if it's an AMP request or not we have to hook into parse_query at a later priority. +add_action( 'admin_bar_init', 'jetpack_initialize_masterbar', 99 ); + +/** + * Initializes the Masterbar in case the request is not AMP. + */ +function jetpack_initialize_masterbar() { + if ( ! Jetpack_AMP_Support::is_amp_request() ) { + new A8C_WPCOM_Masterbar(); + } +} |