WordPress.org

Make WordPress Core

Changeset 23899


Ignore:
Timestamp:
04/04/2013 08:09:02 AM (5 years ago)
Author:
markjaquith
Message:

Standardize the post format theme API functions with the_post_format_THING() and get_the_post_format_THING().

fixes #23927

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/functions.php

    r23824 r23899  
    466466 */
    467467function twentyeleven_get_first_url() {
    468     $has_url = function_exists( 'get_the_url' ) ? get_the_url() : false;
     468    $has_url = function_exists( 'get_the_post_format_url' ) ? get_the_post_format_url() : false;
    469469
    470470    if ( ! $has_url )
  • trunk/wp-content/themes/twentythirteen/content-audio.php

    r23836 r23899  
    2222    <div class="entry-media">
    2323        <div class="audio-content">
    24             <?php the_audio(); ?>
     24            <?php the_post_format_audio(); ?>
    2525        </div><!-- .audio-content -->
    2626    </div><!-- .entry-media -->
  • trunk/wp-content/themes/twentythirteen/content-chat.php

    r23806 r23899  
    2121
    2222    <div class="entry-content">
    23         <?php the_chat(); ?>
     23        <?php the_post_format_chat(); ?>
    2424        <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
    2525    </div><!-- .entry-content -->
  • trunk/wp-content/themes/twentythirteen/content-video.php

    r23839 r23899  
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1212    <div class="entry-media">
    13         <?php the_video(); ?>
     13        <?php the_post_format_video(); ?>
    1414    </div><!-- .entry-media -->
    1515
  • trunk/wp-content/themes/twentythirteen/functions.php

    r23848 r23899  
    441441 */
    442442function twentythirteen_get_link_url() {
    443     $has_url = get_the_url();
     443    $has_url = get_the_post_format_url();
    444444
    445445    return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
  • trunk/wp-includes/media.php

    r23873 r23899  
    20322032 * @return string
    20332033 */
    2034 function get_the_media( $type, &$post = null ) {
     2034function get_the_post_format_media( $type, &$post = null ) {
    20352035    global $wp_embed;
    20362036
     
    21192119 *
    21202120 */
    2121 function the_video() {
    2122     echo get_the_media( 'video' );
     2121function the_post_format_video() {
     2122    echo get_the_post_format_media( 'video' );
    21232123}
    21242124/**
     
    21282128 *
    21292129 */
    2130 function the_audio() {
    2131     echo get_the_media( 'audio' );
     2130function the_post_format_audio() {
     2131    echo get_the_post_format_media( 'audio' );
    21322132}
    21332133
     
    23612361 * @param WP_Post $post Optional. Used instead of global $post when passed.
    23622362 */
    2363 function get_the_image( $attached_size = 'full', &$post = null ) {
     2363function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
    23642364    if ( empty( $post ) )
    23652365        $post = get_post();
     
    24362436 * @param string $attached_size If an attached image is found, the size to display it.
    24372437 */
    2438 function the_image( $attached_size = 'full' ) {
    2439     echo get_the_image( $attached_size );
    2440 }
     2438function the_post_format_image( $attached_size = 'full' ) {
     2439    echo get_the_post_format_image( $attached_size );
     2440}
  • trunk/wp-includes/post-formats.php

    r23880 r23899  
    575575 * @return array
    576576 */
    577 function get_the_chat( $id = 0 ) {
     577function get_the_post_format_chat( $id = 0 ) {
    578578    $post = empty( $id ) ? clone get_post() : get_post( $id );
    579579    if ( empty( $post ) )
     
    593593 * @since 3.6.0
    594594 *
    595  * @uses get_the_chat()
     595 * @uses get_the_post_format_chat()
    596596 *
    597597 * @print HTML
    598598 */
    599 function the_chat() {
     599function the_post_format_chat() {
    600600    $output  = '<dl class="chat">';
    601     $stanzas = get_the_chat();
     601    $stanzas = get_the_post_format_chat();
    602602
    603603    foreach ( $stanzas as $stanza ) {
     
    674674 * @return string A URL, if found.
    675675 */
    676 function get_the_url( $id = 0 ) {
     676function get_the_post_format_url( $id = 0 ) {
    677677    $post = empty( $id ) ? get_post() : get_post( $id );
    678678    if ( empty( $post ) )
     
    682682        $meta = get_post_format_meta( $post->ID );
    683683        if ( ! empty( $meta['url'] ) )
    684             return apply_filters( 'get_the_url', esc_url_raw( $meta['url'] ), $post );
     684            return apply_filters( 'get_the_post_format_url', esc_url_raw( $meta['url'] ), $post );
    685685    }
    686686
    687687    if ( ! empty( $post->post_content ) )
    688         return apply_filters( 'get_the_url', get_content_url( $post->post_content ), $post );
     688        return apply_filters( 'get_the_post_format_url', get_content_url( $post->post_content ), $post );
    689689}
    690690
     
    695695 *.
    696696 */
    697 function the_url() {
    698     echo esc_url( get_the_url() );
     697function the_post_format_url() {
     698    echo esc_url( get_the_post_format_url() );
    699699}
    700700
  • trunk/wp-includes/query.php

    r23876 r23899  
    36983698        switch ( $format ) {
    36993699        case 'image':
    3700             get_the_image( 'full', $post );
     3700            get_the_post_format_image( 'full', $post );
    37013701            if ( isset( $post->split_content ) )
    37023702                $split_content = $post->split_content;
    37033703            break;
    37043704        case 'audio':
    3705             get_the_media( 'audio', $post );
     3705            get_the_post_format_media( 'audio', $post );
    37063706            if ( isset( $post->split_content ) )
    37073707                $split_content = $post->split_content;
    37083708            break;
    37093709        case 'video':
    3710             get_the_media( 'video', $post );
     3710            get_the_post_format_media( 'video', $post );
    37113711            if ( isset( $post->split_content ) )
    37123712                $split_content = $post->split_content;
Note: See TracChangeset for help on using the changeset viewer.