Make WordPress Core


Ignore:
Timestamp:
09/04/2012 04:29:28 PM (12 years ago)
Author:
ryan
Message:

Use get_post() instead of global $post.
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.

Props nacin
see #21309

File:
1 edited

Legend:

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

    r21549 r21735  
    420420 */
    421421function wp_admin_bar_edit_menu( $wp_admin_bar ) {
    422     global $post, $tag, $wp_the_query;
     422    global $tag, $wp_the_query;
    423423
    424424    if ( is_admin() ) {
    425425        $current_screen = get_current_screen();
     426        $post = get_post();
    426427
    427428        if ( 'post' == $current_screen->base
     
    620621
    621622    $title = '<span class="ab-icon"></span><span class="ab-label">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';
    622     $title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>'; 
     623    $title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>';
    623624
    624625    $wp_admin_bar->add_menu( array(
Note: See TracChangeset for help on using the changeset viewer.