| 1 |
<?php |
| 2 |
/** |
| 3 |
* Module Name: WordPress.com Toolbar |
| 4 |
* Module Description: Replaces the admin bar with a useful toolbar to quickly manage your site via WordPress.com. |
| 5 |
* Sort Order: 38 |
| 6 |
* Recommendation Order: 16 |
| 7 |
* First Introduced: 4.8 |
| 8 |
* Requires Connection: Yes |
| 9 |
* Auto Activate: No |
| 10 |
* Module Tags: General |
| 11 |
* Additional Search Queries: adminbar, masterbar |
| 12 |
*/ |
| 13 |
|
| 14 |
require dirname( __FILE__ ) . '/masterbar/masterbar.php'; |
| 15 |
|
| 16 |
// 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. |
| 17 |
add_action( 'admin_bar_init', 'jetpack_initialize_masterbar', 99 ); |
| 18 |
|
| 19 |
/** |
| 20 |
* Initializes the Masterbar in case the request is not AMP. |
| 21 |
*/ |
| 22 |
function jetpack_initialize_masterbar() { |
| 23 |
if ( ! Jetpack_AMP_Support::is_amp_request() ) { |
| 24 |
new A8C_WPCOM_Masterbar(); |
| 25 |
} |
| 26 |
} |
| 27 |
|