WordPress.org

Make WordPress Core

Ticket #15592: 15592.patch

File 15592.patch, 1.5 KB (added by ocean90, 7 years ago)
  • wp-includes/admin-bar.php

     
    285285 * Style and scripts for the admin bar.
    286286 *
    287287 * @since 3.1.0
    288  * @todo move js into a admin-bar js file
    289288 *
    290289 */
    291290function wp_admin_bar_header() {
    292291        ?>
    293         <style type="text/css" media="print">#wpadminbar { display:none; }</style>
     292<style type="text/css" media="print">#wpadminbar { display:none; }</style>
    294293        <?php
    295294}
    296295
    297296/**
     297 * Default admin bar callback.
     298 *
     299 * @since 3.1.0
     300 *
     301 */
     302function _admin_bar_bump_cb() {
     303        ?>
     304<style type="text/css">body { padding-top: 28px !important; }</style>
     305        <?php
     306}
     307
     308/**
    298309 * Determine whether the admin bar should be showing.
    299310 *
    300311 * @since 3.1.0
  • wp-includes/class-wp-admin-bar.php

     
    3636
    3737                add_action( 'admin_head', 'wp_admin_bar_header' );
    3838
     39                if ( current_theme_supports( 'admin-bar' ) ) {
     40                        $admin_bar_args = get_theme_support( 'admin-bar' ); // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
     41                        $header_callback = $admin_bar_args[0]['callback'];
     42                }
     43
     44                if ( empty($header_callback) )
     45                        $header_callback = '_admin_bar_bump_cb';
     46
     47                add_action('wp_head', $header_callback);
     48
    3949                wp_enqueue_script( 'admin-bar' );
    4050                wp_enqueue_style( 'admin-bar' );
    4151