Changeset 16070 for trunk/wp-includes/admin-bar.php
- Timestamp:
- 10/29/2010 07:25:58 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/admin-bar.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r16058 r16070 171 171 global $wp_admin_bar; 172 172 173 /* Add the Site Info menu */ 174 $wp_admin_bar->add_menu( array( 'id' => 'bloginfo', 'title' => __( 'Site Info' ), 'href' => '', ) ); 175 176 // TODO: Move this js out into a seperate file? 177 $wp_admin_bar->add_menu( array( 'parent' => 'bloginfo', 'title' => __( 'Get Shortlink' ), 'href' => '', 'meta' => array( 178 'onclick' => 'javascript:function wpcomshort() { var url=document.location;var links=document.getElementsByTagName('link');var found=0;for(var i = 0, l; l = links[i]; i++){if(l.getAttribute('rel')=='shortlink') {found=l.getAttribute('href');break;}}if (!found) {for (var i = 0; l = document.links[i]; i++) {if (l.getAttribute('rel') == 'shortlink') {found = l.getAttribute('href');break;}}}if (found) {prompt('' . esc_js( __( 'URL:' ) ) . '', found);} else {alert('' . esc_js( __( 'No shortlink available for this page.' ) ) . ''); } } wpcomshort(); return false;' ) ) ); 173 $wp_admin_bar->add_menu( array( 'id' => 'get-shortlink', 'title' => __( 'Get Shortlink' ), 'href' => '', ) ); 179 174 } 180 175 … … 209 204 ?> 210 205 <style type="text/css" media="print">#wpadminbar { display:none; }</style> 211 <script type="text/javascript">212 /* <![CDATA[ */213 (function(d, w) {214 var init = function() {215 var b = d.getElementsByTagName('body')[0],216 aB = d.getElementById('wpadminbar'),217 s = d.getElementById('adminbar-search');218 219 if ( b && aB )220 b.appendChild( aB );221 222 if ( s ) {223 if ( '' == s.value )224 s.value = s.getAttribute('title');225 226 s.onblur = function() {227 this.value = '' == this.value ? this.getAttribute('title') : this.value;228 }229 s.onfocus = function() {230 this.value = this.getAttribute('title') == this.value ? '' : this.value;231 }232 }233 234 if ( w.location.hash )235 w.scrollBy(0,-32);236 }237 238 if ( w.addEventListener )239 w.addEventListener('load', init, false);240 else if ( w.attachEvent )241 w.attachEvent('onload', init);242 243 })(document, window);244 /* ]]> */245 </script>246 206 <?php 247 207 } … … 273 233 } 274 234 275 add_action('wp_head', 'wp_admin_body_style');276 add_action('admin_head', 'wp_admin_body_style');277 278 235 /** 279 236 * Determine whether the admin bar should be showing. … … 292 249 $show_admin_bar = (bool) WP_SHOW_ADMIN_BAR; 293 250 294 if ( ! is_user_logged_in() ) 251 if ( 252 ! is_user_logged_in() || 253 ( is_admin() && ! is_multisite() ) 254 ) 295 255 $show_admin_bar = false; 296 256 }
Note: See TracChangeset
for help on using the changeset viewer.