WordPress.org

Make WordPress Core

Ticket #31742: 31742.3.diff

File 31742.3.diff, 640 bytes (added by sirbrillig, 5 years ago)

A different approach: use a fallback for the current image.

  • wp-includes/js/customize-views.js

     
    2424                },
    2525
    2626                render: function() {
     27                        // fall back to raw current header image if no model was set
     28                        if ( api.get().header_image && ! this.model.get( 'choice' ) ) {
     29                                this.model.set( { choice: api.get().header_image, header: { thumbnail_url: api.get().header_image } }, { silent: true } );
     30                        }
    2731                        this.$el.html(this.template(this.model.toJSON()));
    2832                        this.setPlaceholder();
    2933                        this.setButtons();