Make WordPress Core

Changeset 16636


Ignore:
Timestamp:
11/30/2010 09:50:57 PM (14 years ago)
Author:
ryan
Message:

Add bump down for menu bar. Allow themes to add a custom bump callback. Props ocean90. fixes #15592

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r16610 r16636  
    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>
     293    <?php
     294}
     295
     296/**
     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>
    294305    <?php
    295306}
  • trunk/wp-includes/class-wp-admin-bar.php

    r16600 r16636  
    3636
    3737        add_action( 'admin_head', 'wp_admin_bar_header' );
     38
     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);
    3848
    3949        wp_enqueue_script( 'admin-bar' );
Note: See TracChangeset for help on using the changeset viewer.