Make WordPress Core

Changeset 34216


Ignore:
Timestamp:
09/15/2015 08:45:32 PM (11 years ago)
Author:
wonderboymusic
Message:

Apply the new 'respond_link' filter in comments_popup_link() if $number is 0 before outputting the URL.

Props joedolson.
Fixes #29454.

File:
1 edited

Legend:

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

    r34075 r34216  
    13421342                echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
    13431343                echo '" onclick="wpopen(this.href); return false"';
    1344         } else { // if comments_popup_script() is not in the template, display simple comment link
    1345                 if ( 0 == $number )
    1346                         echo get_permalink() . '#respond';
    1347                 else
     1344        } else {
     1345                // if comments_popup_script() is not in the template, display simple comment link
     1346                if ( 0 == $number ) {
     1347                        $respond_link = get_permalink() . '#respond';
     1348                        /**
     1349                         * Filter the respond link when a post has no comments.
     1350                         *
     1351                         * @since 4.4.0
     1352                         *
     1353                         * @param string $respond_link The default response link.
     1354                         * @param integer $id The post ID.
     1355                         */
     1356                        echo apply_filters( 'respond_link', $respond_link, $id );
     1357                } else {
    13481358                        comments_link();
     1359                }
    13491360                echo '"';
    13501361        }
Note: See TracChangeset for help on using the changeset viewer.