diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-07 13:06:14 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-07 13:06:14 +0100 |
| commit | 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 (patch) | |
| tree | f7453d7dd5cbaaab246e23810b02d3edf1e451be /srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php | |
| parent | c59bdcf77c50cbe89b4a93782cdd6d9e7532080e (diff) | |
| download | ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.gz ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.bz2 ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.zip | |
Added wordpress
Diffstat (limited to 'srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php')
| -rw-r--r-- | srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php b/srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php new file mode 100644 index 0000000..b31a811 --- /dev/null +++ b/srcs/wordpress/wp-includes/customize/class-wp-customize-background-image-control.php @@ -0,0 +1,59 @@ +<?php +/** + * Customize API: WP_Customize_Background_Image_Control class + * + * @package WordPress + * @subpackage Customize + * @since 4.4.0 + */ + +/** + * Customize Background Image Control class. + * + * @since 3.4.0 + * + * @see WP_Customize_Image_Control + */ +class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control { + public $type = 'background'; + + /** + * Constructor. + * + * @since 3.4.0 + * @uses WP_Customize_Image_Control::__construct() + * + * @param WP_Customize_Manager $manager Customizer bootstrap instance. + */ + public function __construct( $manager ) { + parent::__construct( + $manager, + 'background_image', + array( + 'label' => __( 'Background Image' ), + 'section' => 'background_image', + ) + ); + } + + /** + * Enqueue control related scripts/styles. + * + * @since 4.1.0 + */ + public function enqueue() { + parent::enqueue(); + + $custom_background = get_theme_support( 'custom-background' ); + wp_localize_script( + 'customize-controls', + '_wpCustomizeBackground', + array( + 'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(), + 'nonces' => array( + 'add' => wp_create_nonce( 'background-add' ), + ), + ) + ); + } +} |
