PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-masterbar/src/class-main.php +73 -0 16.2-beta → 16.3 View file →
@@ -1,0 +1,73 @@
1 +<?php
2 +/**
3 + * Main class for the Masterbar package.
4 + *
5 + * @package automattic/jetpack-masterbar
6 + */
7 +
8 +namespace Automattic\Jetpack\Masterbar;
9 +
10 +use Automattic\Jetpack\Status\Host;
11 +
12 +/**
13 + * Main class for the Masterbar package.
14 + */
15 +class Main {
16 +
17 + const PACKAGE_VERSION = '0.29.2';
18 +
19 + /**
20 + * Initializer.
21 + * Used to configure the Masterbar package.
22 + *
23 + * @return void
24 + */
25 + public static function init() {
26 + if ( did_action( 'jetpack_masterbar_init' ) ) {
27 + return;
28 + }
29 +
30 + new Admin_Color_Schemes();
31 +
32 + remove_filter( 'pre_option_wpcom_admin_interface', 'wpcom_admin_interface_pre_get_option' );
33 + $is_wp_admin_interface = get_option( 'wpcom_admin_interface' ) === 'wp-admin';
34 + if ( function_exists( 'wpcom_admin_interface_pre_get_option' ) ) {
35 + add_filter( 'pre_option_wpcom_admin_interface', 'wpcom_admin_interface_pre_get_option', 10 );
36 + }
37 +
38 + // Show Additional CSS nudges on both Simple and Atomic, independently of the admin interface.
39 + require_once __DIR__ . '/nudges/bootstrap.php';
40 +
41 + if ( $is_wp_admin_interface ) {
42 + return;
43 + }
44 +
45 + $host = new Host();
46 +
47 + new Inline_Help();
48 + require_once __DIR__ . '/wp-posts-list/bootstrap.php';
49 +
50 + if ( $host->is_woa_site() ) {
51 + require_once __DIR__ . '/profile-edit/bootstrap.php';
52 + }
53 +
54 + /**
55 + * Whether to load the admin menu functionality.
56 + *
57 + * @use add_filter( 'jetpack_load_admin_menu_class', '__return_true' );
58 + *
59 + * @param bool $load_admin_menu_class Load Jetpack's custom admin menu functionality. Default to false.
60 + */
61 + if ( apply_filters( 'jetpack_load_admin_menu_class', false ) ) {
62 + require_once __DIR__ . '/admin-menu/load.php';
63 + }
64 +
65 + /**
66 + * Fires after the Masterbar package is initialized.
67 + * Used mainly to ensure the package is initialized once.
68 + *
69 + * @since 0.1.0
70 + */
71 + do_action( 'jetpack_masterbar_init' );
72 + }
73 +}