Ticket #31779: 31779.3.diff
File 31779.3.diff, 4.6 KB (added by , 7 years ago) |
---|
-
src/wp-admin/css/common.css
3147 3147 line-height: 180%; 3148 3148 } 3149 3149 3150 #file-editor-warning .file-editor-warning-content { 3151 margin: 25px; 3152 } 3153 3150 3154 /* @todo: can we use a common class for these? */ 3151 3155 .nav-menus-php .item-edit:before, 3152 3156 .widget-top .widget-action .toggle-indicator:before, -
src/wp-admin/js/theme-plugin-editor.js
46 46 component.form.on( 'submit', component.submit ); 47 47 component.textarea = component.form.find( '#newcontent' ); 48 48 component.textarea.on( 'change', component.onChange ); 49 component.warning = $( '.file-editor-warning' ); 49 50 51 if ( component.warning.length > 0 ) { 52 $( 'body' ).addClass( 'modal-open' ); 53 component.warning.on( 'click', '.notice-dismiss', component.dismissWarning ); 54 }; 55 56 50 57 if ( false !== component.codeEditor ) { 51 58 /* 52 59 * Defer adding notices until after DOM ready as workaround for WP Admin injecting … … 66 73 } ); 67 74 }; 68 75 76 component.dismissWarning = function() { 77 // update user meta 78 // hide modal 79 component.warning.remove(); 80 $( 'body' ).removeClass( 'modal-open' ); 81 82 // return focus 83 } 84 69 85 /** 70 86 * Callback for when a change happens. 71 87 * -
src/wp-admin/plugin-editor.php
280 280 <br class="clear" /> 281 281 </div> 282 282 <?php 283 $hide_notice = get_user_meta( get_current_user_id(), 'hide_plugin_editor_notice', true ); 284 if ( empty( $hide_notice ) ) : 285 ?> 286 <div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js"> 287 <div class="notification-dialog-background"></div> 288 <div class="notification-dialog" role="dialog" aria-labelledby="file-editor-warning-title" tabindex="0"> 289 <div class="file-editor-warning-content"> 290 <h1 id="file-editor-warning-title"><?php _e( 'Heads up!' ); ?></h1> 291 <p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. We recommend that you don’t! Editing plugins directly may introduce incompatibilities that break your site or even leave you staring at the dreaded “White Screen of Death”. Your changes may also be overwritten by future updates.' ); ?></p> 292 <p><?php _e( 'If you absolutely must edit a plugin this way, WordPress will attempt to prevent you from being locked out from the dashboard entirely, but cannot guarantee results. Once dismissed, this notice will not appear again.' ); ?></p> 293 </div> 294 <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e( 'Dismiss' ); ?></span></button> 295 </div> 296 </div> 297 <?php 298 endif; // editor warning notice 283 299 284 300 include(ABSPATH . "wp-admin/admin-footer.php"); -
src/wp-admin/theme-editor.php
309 309 <br class="clear" /> 310 310 </div> 311 311 <?php 312 $hide_notice = get_user_meta( get_current_user_id(), 'hide_theme_editor_notice', true ); 313 if ( empty( $hide_notice ) ) : 314 ?> 315 <div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js"> 316 <div class="notification-dialog-background"></div> 317 <div class="notification-dialog" role="dialog" aria-labelledby="file-editor-warning-title" tabindex="0"> 318 <div class="file-editor-warning-content"> 319 <h1 id="file-editor-warning-title"><?php _e( 'Heads up!' ); ?></h1> 320 <p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. We recommend that you don’t! Editing plugins directly may introduce incompatibilities that break your site or even leave you staring at the dreaded “White Screen of Death”. Your changes may also be overwritten by future updates.' ); ?></p> 321 <p><?php _e( 'If you absolutely must edit a plugin this way, WordPress will attempt to prevent you from being locked out from the dashboard entirely, but cannot guarantee results. Once dismissed, this notice will not appear again.' ); ?></p> 322 </div> 323 <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e( 'Dismiss' ); ?></span></button> 324 </div> 325 </div> 326 <?php 327 endif; // editor warning notice 312 328 313 329 include(ABSPATH . 'wp-admin/admin-footer.php' );