| 114 | | // Do not allow accidental or negligent deregistering of critical scripts in the admin. Show minimal remorse if the correct hook is used. |
| 115 | | if ( is_admin() && 'admin_enqueue_scripts' !== current_filter() ) { |
| 116 | | $no = array( |
| 117 | | 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', |
| 118 | | 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', |
| 119 | | 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', |
| 120 | | 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', |
| 121 | | 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', |
| 122 | | 'jquery-ui-tooltip', 'jquery-ui-widget', |
| 123 | | 'underscore', 'backbone', |
| 124 | | ); |
| | 114 | // Do not allow accidental or negligent deregistering of critical scripts in the admin or on the login page. Show minimal remorse if the correct hook is used. |
| | 115 | $no = array( |
| | 116 | 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', |
| | 117 | 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', |
| | 118 | 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', |
| | 119 | 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', |
| | 120 | 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', |
| | 121 | 'jquery-ui-tooltip', 'jquery-ui-widget', |
| | 122 | 'underscore', 'backbone', |
| | 123 | ); |
| 126 | | if ( in_array( $handle, $no ) ) { |
| 127 | | $message = sprintf( __( 'Do not deregister the %1$s script in the administration area. To target the frontend theme, use the %2$s hook.' ), |
| 128 | | "<code>$handle</code>", '<code>wp_enqueue_scripts</code>' ); |
| 129 | | _doing_it_wrong( __FUNCTION__, $message, '3.6' ); |
| 130 | | return; |
| 131 | | } |
| | 125 | if ( is_admin() && 'admin_enqueue_scripts' !== current_filter() && in_array( $handle, $no ) ) { |
| | 126 | $message = sprintf( __( 'Do not deregister the %1$s script in the administration area. To target the frontend theme, use the %2$s hook.' ), |
| | 127 | "<code>$handle</code>", '<code>wp_enqueue_scripts</code>' ); |
| | 128 | _doing_it_wrong( __FUNCTION__, $message, '3.6' ); |
| | 129 | return; |