WordPress.org

Make WordPress Core

Ticket #44838: 44838.4.diff

File 44838.4.diff, 1.5 KB (added by audrasjb, 2 months ago)

Proposal: some enhancements to inline docs

  • src/wp-includes/feed.php

    diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
    index bd0c06f..e5237a7 100644
    a b function rss2_site_icon() { 
    616616}
    617617
    618618/**
    619  * Display the link for the currently displayed feed in a XSS safe way.
     619 * Returns the link for the currently displayed feed in a XSS safe way.
    620620 *
    621  * Generate a correct link for the atom:self element.
     621 * @since 5.3.0 The `get_self_link()` function was introduced to return the link. Now used in `self_link()` display function.
    622622 *
    623  * @since 2.5.0
     623 * @return string Correct link for the atom:self element.
    624624 */
    625 function self_link() {
     625function get_self_link() {
    626626        $host = @parse_url( home_url() );
    627627        /**
    628628         * Filters the current feed URL.
    function self_link() { 
    634634         *
    635635         * @param string $feed_link The link for the feed with set URL scheme.
    636636         */
    637         echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
     637        return esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
    638638}
    639639
     640/**
     641 * Display the link for the currently displayed feed in a XSS safe way.
     642 *
     643 * Generate a correct link for the atom:self element.
     644 *
     645 * @since 2.5.0
     646 * @since 5.3.0 Displays the string returned by `get_self_link()` function.
     647 *
     648 */
     649function self_link() {
     650        echo esc_url( get_self_link() );
     651}
    640652/*
    641653 * Get the timestamp of the most recently modified post from WP_Query.
    642654 *