equal
deleted
inserted
replaced
24 * @uses WP_Customize_Image_Control::__construct() |
24 * @uses WP_Customize_Image_Control::__construct() |
25 * |
25 * |
26 * @param WP_Customize_Manager $manager Customizer bootstrap instance. |
26 * @param WP_Customize_Manager $manager Customizer bootstrap instance. |
27 */ |
27 */ |
28 public function __construct( $manager ) { |
28 public function __construct( $manager ) { |
29 parent::__construct( $manager, 'background_image', array( |
29 parent::__construct( |
30 'label' => __( 'Background Image' ), |
30 $manager, |
31 'section' => 'background_image', |
31 'background_image', |
32 ) ); |
32 array( |
|
33 'label' => __( 'Background Image' ), |
|
34 'section' => 'background_image', |
|
35 ) |
|
36 ); |
33 } |
37 } |
34 |
38 |
35 /** |
39 /** |
36 * Enqueue control related scripts/styles. |
40 * Enqueue control related scripts/styles. |
37 * |
41 * |
39 */ |
43 */ |
40 public function enqueue() { |
44 public function enqueue() { |
41 parent::enqueue(); |
45 parent::enqueue(); |
42 |
46 |
43 $custom_background = get_theme_support( 'custom-background' ); |
47 $custom_background = get_theme_support( 'custom-background' ); |
44 wp_localize_script( 'customize-controls', '_wpCustomizeBackground', array( |
48 wp_localize_script( |
45 'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(), |
49 'customize-controls', |
46 'nonces' => array( |
50 '_wpCustomizeBackground', |
47 'add' => wp_create_nonce( 'background-add' ), |
51 array( |
48 ), |
52 'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(), |
49 ) ); |
53 'nonces' => array( |
|
54 'add' => wp_create_nonce( 'background-add' ), |
|
55 ), |
|
56 ) |
|
57 ); |
50 } |
58 } |
51 } |
59 } |