Make WordPress Core


Ignore:
Timestamp:
09/04/2012 04:29:28 PM (13 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/comment-template.php

    r21364 r21735  
    811811 */
    812812function wp_comment_form_unfiltered_html_nonce() {
    813     global $post;
    814 
    815     $post_id = 0;
    816     if ( !empty($post) )
    817         $post_id = $post->ID;
     813    $post = get_post();
     814    $post_id = $post ? $post->ID : 0;
    818815
    819816    if ( current_user_can( 'unfiltered_html' ) ) {
Note: See TracChangeset for help on using the changeset viewer.