Ticket #18197: 18197.diff
File 18197.diff, 4.2 KB (added by , 14 years ago) |
---|
-
wp-includes/admin-bar.php
386 386 function is_admin_bar_showing() { 387 387 global $show_admin_bar, $pagenow; 388 388 389 / * For all these types of request we never want an admin bar period */389 // For all these types of requests, we never want an admin bar. 390 390 if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') ) 391 391 return false; 392 392 393 // Integrated into the admin. 394 if ( is_admin() ) 395 return true; 396 393 397 if ( ! isset( $show_admin_bar ) ) { 394 398 if ( ! is_user_logged_in() || 'wp-login.php' == $pagenow ) { 395 399 $show_admin_bar = false; 396 400 } else { 397 $context = is_admin() ? 'admin' : 'front'; 398 $show_admin_bar = _get_admin_bar_pref( $context ); 401 $show_admin_bar = _get_admin_bar_pref(); 399 402 } 400 403 } 401 404 … … 405 408 } 406 409 407 410 /** 408 * Retrieve the admin bar display preference of a user based on context.411 * Retrieve the admin bar display preference of a user. 409 412 * 410 413 * @since 3.1.0 411 414 * @access private 412 415 * 413 * @param string $context Context of this preference check, either 'admin' or 'front'. 416 * @param string $context Context of this preference check. Defaults to 'front'. The 'admin' 417 * preference is no longer used. 414 418 * @param int $user Optional. ID of the user to check, defaults to 0 for current user. 415 419 * @return bool Whether the admin bar should be showing for this user. 416 420 */ 417 function _get_admin_bar_pref( $context , $user = 0 ) {421 function _get_admin_bar_pref( $context = 'front', $user = 0 ) { 418 422 $pref = get_user_option( "show_admin_bar_{$context}", $user ); 419 423 if ( false === $pref ) 420 424 return true; -
wp-includes/version.php
11 11 * 12 12 * @global int $wp_db_version 13 13 */ 14 $wp_db_version = 185 41;14 $wp_db_version = 18566; 15 15 16 16 /** 17 17 * Holds the TinyMCE version -
wp-admin/includes/upgrade.php
451 451 if ( $wp_current_db_version < 15260 ) 452 452 upgrade_300(); 453 453 454 if ( $wp_current_db_version < 18566 ) 455 upgrade_330(); 456 454 457 maybe_disable_automattic_widgets(); 455 458 456 459 update_option( 'db_version', $wp_db_version ); … … 1132 1135 } 1133 1136 1134 1137 /** 1138 * Execute changes made in WordPress 3.3. 1139 * 1140 * @since 3.3.0 1141 */ 1142 function upgrade_330() { 1143 global $wp_current_db_version, $wpdb; 1144 1145 // Admin Bar preference for the admin. 1146 $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key = 'show_admin_bar_admin'" ); 1147 } 1148 1149 /** 1135 1150 * Execute network level changes 1136 1151 * 1137 1152 * @since 3.0.0 -
wp-admin/user-edit.php
213 213 </tr> 214 214 <?php endif; ?> 215 215 <tr class="show-admin-bar"> 216 <th scope="row"><?php _e(' ShowAdmin Bar')?></th>217 <td><fieldset><legend class="screen-reader-text"><span><?php _e(' ShowAdmin Bar') ?></span></legend>216 <th scope="row"><?php _e('Admin Bar')?></th> 217 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Admin Bar') ?></span></legend> 218 218 <label for="admin_bar_front"> 219 <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> /> 220 <?php /* translators: Show admin bar when viewing site */ _e( 'when viewing site' ); ?></label><br /> 221 <label for="admin_bar_admin"> 222 <input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> /> 223 <?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard' ); ?></label></fieldset> 219 <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> /> 220 <?php _e( 'Show Admin Bar when viewing site' ); ?></label><br /> 221 </fieldset> 224 222 </td> 225 223 </tr> 226 224 <?php do_action('personal_options', $profileuser); ?>