PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
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 13.7.2 All 507 releases
jetpack / jetpack_vendor / automattic / jetpack-masterbar / src / nudges / bootstrap.php

bootstrap.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.7, at jetpack_vendor/automattic/jetpack-masterbar/src/nudges/bootstrap.php

56 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Bootstrap file for the nudges.
4 *
5 * @package automattic/jetpack-masterbar
6 */
7
8 namespace Automattic\Jetpack\Masterbar;
9
10 use Automattic\Jetpack\Status;
11 use Automattic\Jetpack\Status\Host;
12
13 /**
14 * The WP_Customize_Control core class is loaded only on customize_register.
15 *
16 * @param \WP_Customize_Manager $customize_manager Core customize manager.
17 */
18 function register_css_nudge_control( \WP_Customize_Manager $customize_manager ) {
19 $domain = ( new Status() )->get_site_suffix();
20
21 if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
22 $manager = new WPCOM_Additional_CSS_Manager( $domain );
23 } elseif ( ( new Host() )->is_woa_site() ) {
24 $manager = new Atomic_Additional_CSS_Manager( $domain );
25 }
26
27 if ( ! isset( $manager ) ) {
28 return;
29 }
30
31 $manager->register_nudge( $customize_manager );
32 }
33
34 /**
35 * Load the bootstrap on init action.
36 *
37 * We need to load on init because otherwise the filter will not be set to true in WPCOM (since the add_filter is set on init).
38 */
39 function load_bootstrap_on_init() {
40
41 /**
42 * Disable Additional CSS section from Customizer in WPCOM and Atomic and replace it with a nudge.
43 *
44 * @module masterbar
45 *
46 * @since jetpack-9.9.0
47 *
48 * @param bool
49 */
50 if ( \apply_filters( 'jetpack_customize_enable_additional_css_nudge', false ) ) {
51 \add_action( 'customize_register', __NAMESPACE__ . '\register_css_nudge_control' );
52 }
53 }
54
55 add_action( 'init', __NAMESPACE__ . '\load_bootstrap_on_init' );
56