Make WordPress Core


Ignore:
Timestamp:
09/09/2015 02:50:43 AM (10 years ago)
Author:
wonderboymusic
Message:

After [33891], get_comment() returns global $comment if no args are passed and the global is set (after setting the default to null here). This allows us to ditch global comment imports.

See #33638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r33962 r33963  
    153153 * address and use it for their own means good and bad.
    154154 *
    155  * @global object $comment The current Comment row object.
    156  *
    157155 * @since 2.7.0
    158156 *
     
    164162 */
    165163function get_comment_author_email_link( $linktext = '', $before = '', $after = '' ) {
    166     global $comment;
    167 
     164    $comment = get_comment();
    168165    /**
    169166     * Filter the comment author's email for display.
     
    605602 * @since 1.5.0
    606603 *
    607  * @global object $comment
    608  *
    609604 * @return int The comment ID.
    610605 */
    611606function get_comment_ID() {
    612     global $comment;
     607    $comment = get_comment();
    613608
    614609    /**
     
    874869 * @since 1.5.0
    875870 *
    876  * @global object $comment
    877  *
    878871 * @param string $d         Optional. The format of the time. Default user's settings.
    879872 * @param bool   $gmt       Optional. Whether to use the GMT date. Default false.
     
    883876 */
    884877function get_comment_time( $d = '', $gmt = false, $translate = true ) {
    885     global $comment;
     878    $comment = get_comment();
     879
    886880    $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
    887881    if ( '' == $d )
     
    16541648 * @since 2.7.0
    16551649 *
    1656  * @global object $comment
    1657  *
    16581650 * @param string $noreplytext  Optional. Text to display when not replying to a comment.
    16591651 *                             Default false.
     
    16651657 */
    16661658function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
    1667     global $comment;
     1659    $comment = get_comment();
    16681660
    16691661    if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
Note: See TracChangeset for help on using the changeset viewer.