css
5 years ago
js
5 years ago
class-atomic-additional-css-manager.php
2 years ago
class-css-customizer-nudge.php
2 years ago
class-css-nudge-customize-control.php
2 years ago
class-wpcom-additional-css-manager.php
2 years ago
class-css-customizer-nudge.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CSS_Customizer_Nudge file. |
| 4 | * CSS Nudge implementation for Atomic and WPCOM. |
| 5 | * |
| 6 | * @deprecated 13.7 Use Automattic\Jetpack\Masterbar\CSS_Customizer_Nudge instead. |
| 7 | * |
| 8 | * @package Jetpack |
| 9 | */ |
| 10 | |
| 11 | namespace Automattic\Jetpack\Dashboard_Customizations; |
| 12 | |
| 13 | use Automattic\Jetpack\Masterbar\CSS_Customizer_Nudge as Masterbar_CSS_Customizer_Nudge; |
| 14 | |
| 15 | /** |
| 16 | * Class WPCOM_CSS_Customizer |
| 17 | * |
| 18 | * @package Automattic\Jetpack\Dashboard_Customizations |
| 19 | */ |
| 20 | class CSS_Customizer_Nudge { |
| 21 | /** |
| 22 | * Instance of \Automattic\Jetpack\Masterbar\CSS_Customizer_Nudge |
| 23 | * Used for deprecation purposes. |
| 24 | * |
| 25 | * @var \Automattic\Jetpack\Masterbar\CSS_Customizer_Nudge |
| 26 | */ |
| 27 | private $css_customizer_nudge_wrapper; |
| 28 | |
| 29 | /** |
| 30 | * CSS_Customizer_Nudge constructor. |
| 31 | * |
| 32 | * @deprecated 13.7 |
| 33 | * |
| 34 | * @param string $cta_url The URL to the plans. |
| 35 | * @param string $nudge_copy The nudge text. |
| 36 | * @param string $control_name The slug prefix of the nudge. |
| 37 | */ |
| 38 | public function __construct( $cta_url, $nudge_copy, $control_name = 'custom_css' ) { |
| 39 | _deprecated_function( __METHOD__, 'jetpack-13.7', 'Automattic\\Jetpack\\Masterbar\\CSS_Customizer_Nudge::__construct' ); |
| 40 | $this->css_customizer_nudge_wrapper = new Masterbar_CSS_Customizer_Nudge( $cta_url, $nudge_copy, $control_name ); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Register the assets required for the CSS nudge page from the Customizer. |
| 45 | * |
| 46 | * @deprecated 13.7 |
| 47 | */ |
| 48 | public function customize_controls_enqueue_scripts_nudge() { |
| 49 | _deprecated_function( __METHOD__, 'jetpack-13.7', 'Automattic\\Jetpack\\Masterbar\\CSS_Customizer_Nudge::customize_controls_enqueue_scripts_nudge' ); |
| 50 | $this->css_customizer_nudge_wrapper->customize_controls_enqueue_scripts_nudge(); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Register the CSS nudge in the Customizer. |
| 55 | * |
| 56 | * @deprecated 13.7 |
| 57 | * |
| 58 | * @param \WP_Customize_Manager $wp_customize The customize manager. |
| 59 | */ |
| 60 | public function customize_register_nudge( \WP_Customize_Manager $wp_customize ) { |
| 61 | _deprecated_function( __METHOD__, 'jetpack-13.7', 'Automattic\\Jetpack\\Masterbar\\CSS_Customizer_Nudge::customize_register_nudge' ); |
| 62 | $this->css_customizer_nudge_wrapper->customize_register_nudge( $wp_customize ); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Create a nudge control object. |
| 67 | * |
| 68 | * @deprecated 13.7 |
| 69 | * |
| 70 | * @param \WP_Customize_Manager $wp_customize The Core Customize Manager. |
| 71 | * |
| 72 | * @return \Automattic\Jetpack\Masterbar\CSS_Nudge_Customize_Control |
| 73 | */ |
| 74 | public function create_css_nudge_control( \WP_Customize_Manager $wp_customize ) { |
| 75 | _deprecated_function( __METHOD__, 'jetpack-13.7', 'Automattic\\Jetpack\\Masterbar\\CSS_Customizer_Nudge::create_css_nudge_control' ); |
| 76 | return $this->css_customizer_nudge_wrapper->create_css_nudge_control( $wp_customize ); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Create the nudge section. |
| 81 | * |
| 82 | * @deprecated 13.7 |
| 83 | * |
| 84 | * @param \WP_Customize_Manager $wp_customize The core Customize Manager. |
| 85 | * |
| 86 | * @return \WP_Customize_Section |
| 87 | */ |
| 88 | public function create_css_nudge_section( \WP_Customize_Manager $wp_customize ) { |
| 89 | _deprecated_function( __METHOD__, 'jetpack-13.7', 'Automattic\\Jetpack\\Masterbar\\CSS_Customizer_Nudge::create_css_nudge_section' ); |
| 90 | return $this->css_customizer_nudge_wrapper->create_css_nudge_section( $wp_customize ); |
| 91 | } |
| 92 | } |
| 93 |