WordPress.org

Make WordPress Core

Ticket #44838: 44838.diff

File 44838.diff, 1001 bytes (added by jojotjebaby, 14 months ago)
  • src/wp-includes/feed.php

    diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
    index c8f5fd5d3d..0f8f46359b 100644
    a b function rss2_site_icon() { 
    621621 * Generate a correct link for the atom:self element.
    622622 *
    623623 * @since 2.5.0
     624 *
     625 * @param bool $echo If the function returns the value or echo's it. Default value is true.
    624626 */
    625 function self_link() {
     627function self_link( $echo = true ) {
    626628        $host = @parse_url( home_url() );
    627629        /**
    628630         * Filters the current feed URL.
    function self_link() { 
    634636         *
    635637         * @param string $feed_link The link for the feed with set URL scheme.
    636638         */
    637         echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
     639
     640        $url = esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
     641
     642        if ( $echo === true ) {
     643                echo $url;
     644        }
     645
     646        return $url;
    638647}
    639648
    640649/**