Ticket #21492: 21492.3.diff
File 21492.3.diff, 3.2 KB (added by , 8 years ago) |
---|
-
wp-includes/class-wp-customize-manager.php
4112 4112 $this->add_setting( 'page_on_front', array( 4113 4113 'type' => 'option', 4114 4114 'capability' => 'manage_options', 4115 'validate_callback' => array( $this, '_validate_page_on_front' ), 4115 4116 ) ); 4116 4117 4117 4118 $this->add_control( 'page_on_front', array( … … 4219 4220 4220 4221 return $color; 4221 4222 } 4223 /** 4224 * Callback for validating page on front value 4225 * 4226 * @since 4.7.3 4227 * 4228 * @param object $validity 4229 * @param mixed $value 4230 * @access private 4231 * @return mixed 4232 */ 4233 public function _validate_page_on_front( $validity, $value ) { 4234 $page_for_posts = absint( get_option( 'page_for_posts', 0 ) ); 4222 4235 4236 $value = absint( $value ); 4237 if ( 0 === $value ) { 4238 return $validity; 4239 } 4240 if ( $value === $page_for_posts ) { 4241 // add error message 4242 $validity->add( 'same_id_for_page_for_posts', __( 'Warning: We advise you to chose a different page for your Posts page.' ) ); 4243 } 4244 return $validity; 4245 } 4246 4223 4247 /** 4224 4248 * Callback for validating a background setting value. 4225 4249 * -
wp-includes/js/media/views/attachments/browser.js
41 41 this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this ); 42 42 this.controller.on( 'edit:selection', this.editSelection ); 43 43 this.createToolbar(); 44 this.createUploader(); 45 this.createAttachments(); 46 if ( this.options.sidebar ) { 47 this.createSidebar(); 44 // if its open in wp-admin/upload.php show sidebar first 45 if ( 'library' === this.model.id ) { 46 if ( this.options.sidebar ) { 47 this.createSidebar(); 48 } 49 this.createUploader(); 50 this.createAttachments(); 51 } else { 52 // if its open inside a modal (not in wp-admin/upload.php ) show uploader and attachments first 53 this.createUploader(); 54 this.createAttachments(); 55 if ( this.options.sidebar ) { 56 this.createSidebar(); 57 } 48 58 } 49 59 this.updateContent(); 50 60 -
wp-includes/js/media-views.js
3772 3772 this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this ); 3773 3773 this.controller.on( 'edit:selection', this.editSelection ); 3774 3774 this.createToolbar(); 3775 this.createUploader(); 3776 this.createAttachments(); 3777 if ( this.options.sidebar ) { 3778 this.createSidebar(); 3775 // if its open in wp-admin/upload.php show sidebar first 3776 if ( 'library' === this.model.id ) { 3777 if ( this.options.sidebar ) { 3778 this.createSidebar(); 3779 } 3780 this.createUploader(); 3781 this.createAttachments(); 3782 } else { 3783 // if its open inside a modal (not in wp-admin/upload.php ) show uploader and attachments first 3784 this.createUploader(); 3785 this.createAttachments(); 3786 if ( this.options.sidebar ) { 3787 this.createSidebar(); 3788 } 3779 3789 } 3780 3790 this.updateContent(); 3781 3791