Ticket #35210: 35210.3.patch
File 35210.3.patch, 4.8 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/customize-controls.css
diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index 36e512a..f442694 100644
a b body { 25 25 26 26 #customize-header-actions .button-primary { 27 27 float: right; 28 position: relative; 29 top: 0; 28 30 margin-top: 9px; 31 margin-right: 15px; 29 32 } 30 33 31 34 #customize-header-actions .spinner { 32 35 margin-top: 13px; 33 36 margin-right: 4px; 37 position: relative; 38 top: -45px; 34 39 } 35 40 36 41 .saving #customize-header-actions .spinner { … … body { 39 44 40 45 #customize-header-actions { 41 46 border-bottom: 1px solid #ddd; 47 padding-top: 0; 48 } 49 50 #customize-header-actions .notice { 51 margin-top: 46px; 52 margin-bottom: 1px; 53 } 54 55 #customize-header-actions .notice + .notice { 56 margin-top: 0; 42 57 } 43 58 44 59 #customize-controls .wp-full-overlay-sidebar-content { -
src/wp-admin/css/themes.css
diff --git a/src/wp-admin/css/themes.css b/src/wp-admin/css/themes.css index 988db99..6b6ef59 100644
a b body.full-overlay-active { 1285 1285 left: 0; 1286 1286 right: 0; 1287 1287 height: 45px; 1288 padding: 0 15px;1288 padding: 0; 1289 1289 line-height: 45px; 1290 1290 z-index: 10; 1291 1291 margin: 0; -
src/wp-admin/customize.php
diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php index 7f667d3..0591f6b 100644
a b add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 53 53 do_action( 'customize_controls_init' ); 54 54 55 55 wp_enqueue_script( 'customize-controls' ); 56 wp_enqueue_script( 'common' ); 56 57 wp_enqueue_style( 'customize-controls' ); 57 58 58 59 /** -
src/wp-admin/js/customize-controls.js
diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index a22aa76..eaf1d71 100644
a b 3355 3355 self.save(); 3356 3356 self.preview.iframe.show(); 3357 3357 } ); 3358 } else if( response && response.error_code != undefined ){ 3359 // inject the error notification div 3360 var template = wp.template('error-notification'); 3361 $( '#customize-header-actions' ).append( template( response ) ); 3362 3363 // trigger the event that make notices dismissible 3364 $(document).trigger( 'wp-plugin-update-error' ); 3358 3365 } 3359 3366 api.trigger( 'error', response ); 3360 3367 } ); -
src/wp-includes/class-wp-customize-manager.php
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 8057e57..e0ec43c 100644
a b final class WP_Customize_Manager { 299 299 add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_panel_templates' ), 1 ); 300 300 add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 ); 301 301 add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 ); 302 add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_error_notification_templates' ), 1 ); 302 303 303 304 // Export the settings to JS via the _wpCustomizeSettings variable. 304 305 add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 ); … … final class WP_Customize_Manager { 2180 2181 'type' => 'dropdown-pages', 2181 2182 ) ); 2182 2183 } 2184 2185 // This is only for demonstration purpose 2186 $this->add_section( 'test-errors', array( 2187 'title' => __( 'Test error notification' ), 2188 'priority' => 10, 2189 ) ); 2190 $this->add_setting( 'test_errors_trigger', array( 2191 'type' => 'option', 2192 'transport' => 'postMessage', 2193 ) ); 2194 $this->add_control( 'test_errors_trigger', array( 2195 'label' => __( 'Enter a message to trigger an error' ), 2196 'setting' => 'test_errors_trigger', 2197 'section' => 'test-errors', 2198 ) ); 2199 2200 add_filter( 'pre_update_option_test_errors_trigger', array( $this, 'send_test_error' ) ); 2201 } 2202 2203 public function send_test_error( $value ){ 2204 // if an error message has been entered, trigger the test error 2205 if( trim($value) != '' ){ 2206 wp_send_json_error( array( 2207 'error_code' => 'test-error-code', 2208 'error_message' => $value, 2209 ) ); 2210 } 2211 return $value; 2183 2212 } 2184 2213 2185 2214 /** … … final class WP_Customize_Manager { 2235 2264 public function _render_custom_logo_partial() { 2236 2265 return get_custom_logo(); 2237 2266 } 2267 2268 public function render_error_notification_templates(){ 2269 ?><script type="text/html" id="tmpl-error-notification"> 2270 <div class="notice is-dismissible error {{ data.error_code }}"> 2271 <p>{{ data.error_message }}</p> 2272 <button type="button" class="notice-dismiss"> 2273 <span class="screen-reader-text"><?php _e( 'Dismiss this notice' ); ?>.</span> 2274 </button> 2275 </div> 2276 </script><?php 2277 } 2238 2278 } 2239 2279 2240 2280 /**