WordPress.org

Make WordPress Core

Ticket #33070: post-template.diff

File post-template.diff, 659 bytes (added by atomicjack, 5 years ago)

Adds in the_thumbnail_url() - takes no parameters.

  • wp-includes/post-template.php

    diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
    index 2a6569f..d185e27 100644
    a b function the_title($before = '', $after = '', $echo = true) { 
    5454}
    5555
    5656/**
     57* Display or retrieve the URL of a posts thumbnail/featured image
     58*
     59* Takes no parameters!
     60*/
     61function the_thumbnail_url() {
     62 $thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id( $post_id ) );
     63    echo $thumbnail_url;
     64}
     65
     66/**
    5767 * Sanitize the current title when retrieving or displaying.
    5868 *
    5969 * Works like {@link the_title()}, except the parameters can be in a string or