[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Customize API: WP_Customize_Background_Image_Control class 4 * 5 * @package WordPress 6 * @subpackage Customize 7 * @since 4.4.0 8 */ 9 10 /** 11 * Customize Background Image Control class. 12 * 13 * @since 3.4.0 14 * 15 * @see WP_Customize_Image_Control 16 */ 17 class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control { 18 19 /** 20 * Customize control type. 21 * 22 * @since 4.1.0 23 * @var string 24 */ 25 public $type = 'background'; 26 27 /** 28 * Constructor. 29 * 30 * @since 3.4.0 31 * @uses WP_Customize_Image_Control::__construct() 32 * 33 * @param WP_Customize_Manager $manager Customizer bootstrap instance. 34 */ 35 public function __construct( $manager ) { 36 parent::__construct( 37 $manager, 38 'background_image', 39 array( 40 'label' => __( 'Background Image' ), 41 'section' => 'background_image', 42 ) 43 ); 44 } 45 46 /** 47 * Enqueue control related scripts/styles. 48 * 49 * @since 4.1.0 50 */ 51 public function enqueue() { 52 parent::enqueue(); 53 54 $custom_background = get_theme_support( 'custom-background' ); 55 wp_localize_script( 56 'customize-controls', 57 '_wpCustomizeBackground', 58 array( 59 'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(), 60 'nonces' => array( 61 'add' => wp_create_nonce( 'background-add' ), 62 ), 63 ) 64 ); 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Thu Nov 21 08:20:01 2024 | Cross-referenced by PHPXref |