[wp-trac] Re: [WordPress Trac] #2701: Centralize javascript inclusions

WordPress Trac wp-trac at lists.automattic.com
Thu May 4 19:10:03 GMT 2006


#2701: Centralize javascript inclusions
----------------------+-----------------------------------------------------
       Id:  2701      |      Status:  assigned                
Component:  General   |    Modified:  Thu May  4 19:10:03 2006
 Severity:  normal    |   Milestone:  2.1                     
 Priority:  normal    |     Version:  2.1                     
    Owner:  mdawaffe  |    Reporter:  mdawaffe                
----------------------+-----------------------------------------------------
Comment (by mdawaffe):

 As an aside, this offers a nice pluggable way to disable scripts that pose
 accessibility concerns.

 {{{
 /*
 Plugin Name:  AJAX b0rked my screen reader.
 */

 add_action( 'wp_print_scripts', 'no_ajax' );

 function no_ajax() {
  global $current_user;
  if ( $current_user->data->no_ajax )
   wp_deregister_script( 'sack' );
 }
 }}}

 With this in mind, we should rewrite the printer such that it doesn't
 include JS with missing dependencies.  That way, the plugin wouldn't have
 to try and non-robustly do {{{wp_deregister_script( 'sack', 'ajaxcat', ...
 );}}}, and the user wouldn't get a lot of JS errors.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2701>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list