WordPress.org

Make WordPress Core

Changeset 11508


Ignore:
Timestamp:
06/03/09 07:06:45 (6 years ago)
Author:
azaozz
Message:

Add $hook_suffix as js var, fixes #10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r11380 r11508  
    2828wp_enqueue_script('utils'); 
    2929 
     30$hook_suffix = ''; 
     31if ( isset($page_hook) ) 
     32    $hook_suffix = "$page_hook"; 
     33else if ( isset($plugin_page) ) 
     34    $hook_suffix = "$plugin_page"; 
     35else if ( isset($pagenow) ) 
     36    $hook_suffix = "$pagenow"; 
     37 
     38$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 
    3039?> 
    3140<script type="text/javascript"> 
     
    3342addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 
    3443var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'}; 
    35 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; 
    36 var pagenow = '<?php echo substr($pagenow, 0, -4); ?>'; 
     44var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>'; 
    3745//]]> 
    3846</script> 
     
    4452} 
    4553 
    46 $hook_suffix = ''; 
    47 if ( isset($page_hook) ) 
    48     $hook_suffix = "$page_hook"; 
    49 else if ( isset($plugin_page) ) 
    50     $hook_suffix = "$plugin_page"; 
    51 else if ( isset($pagenow) ) 
    52     $hook_suffix = "$pagenow"; 
    53  
    5454do_action('admin_enqueue_scripts', $hook_suffix); 
    5555do_action("admin_print_styles-$hook_suffix"); 
     
    6060do_action('admin_head'); 
    6161 
    62 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 
    6362if ( get_user_setting('mfold') == 'f' ) { 
    6463    $admin_body_class .= ' folded'; 
Note: See TracChangeset for help on using the changeset viewer.