Make WordPress Core


Ignore:
Timestamp:
12/15/2014 11:27:17 PM (10 years ago)
Author:
ocean90
Message:

Customizer: Add _wp_attachment_is_custom_background meta to uploaded background images.

Adds $type property to WP_Customize_Background_Image_Control (PHP) and introduces wp.customize.BackgroundControl (JS).

see #30707.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r30849 r30885  
    880880 */
    881881class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
     882    public $type = 'background';
    882883
    883884    /**
     
    893894            'label'    => __( 'Background Image' ),
    894895            'section'  => 'background_image',
     896        ) );
     897    }
     898
     899    /**
     900     * Enqueue control related scripts/styles.
     901     *
     902     * @since 4.1.0
     903     */
     904    public function enqueue() {
     905        parent::enqueue();
     906
     907        wp_localize_script( 'customize-controls', '_wpCustomizeBackground', array(
     908            'nonces' => array(
     909                'add' => wp_create_nonce( 'background-add' ),
     910            ),
    895911        ) );
    896912    }
     
    913929            ),
    914930            'section'  => 'header_image',
    915             'context'  => 'custom-header',
    916931            'removed'  => 'remove-header',
    917932            'get_url'  => 'get_header_image',
Note: See TracChangeset for help on using the changeset viewer.