Make WordPress Core

Ticket #23882: 23882.3.patch

File 23882.3.patch, 864 bytes (added by chriscct7, 11 years ago)

Added $id param to the filter and set $id's default to false to match get_permalink

  • src/wp-includes/link-template.php

     
    1414 *
    1515 * @param int|WP_Post $id Optional. Post ID or post object. Default current post.
    1616 */
    17 function the_permalink( $id = 0 ) {
     17function the_permalink( $id = false ) {
    1818        /**
    1919         * Filter the display of the permalink for the current post.
    2020         *
    2121         * @since 1.5.0
     22         * @since 4.4.0 $id param added
    2223         *
    2324         * @param string $permalink The permalink for the current post.
     25         * @param int|WP_Post $id   Optional. Post ID or post object. Default current post.
    2426         */
    25         echo esc_url( apply_filters( 'the_permalink', get_permalink( $id ) ) );
     27        echo esc_url( apply_filters( 'the_permalink', get_permalink( $id ), $id ) );
    2628}
    2729
    2830/**