From 15dc5a371866f55488101b32dfe6f8f19c4235ea Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 4 Apr 2013 08:09:02 +0000 Subject: [PATCH] Standardize the post format theme API functions with the_post_format_THING() and get_the_post_format_THING(). fixes #23927 git-svn-id: http://core.svn.wordpress.org/trunk@23899 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyeleven/functions.php | 2 +- .../themes/twentythirteen/content-audio.php | 2 +- .../themes/twentythirteen/content-chat.php | 2 +- .../themes/twentythirteen/content-video.php | 2 +- wp-content/themes/twentythirteen/functions.php | 2 +- wp-includes/media.php | 16 ++++++++-------- wp-includes/post-formats.php | 18 +++++++++--------- wp-includes/query.php | 6 +++--- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php index e34f15f442..cac721f1e3 100644 --- a/wp-content/themes/twentyeleven/functions.php +++ b/wp-content/themes/twentyeleven/functions.php @@ -465,7 +465,7 @@ endif; // twentyeleven_content_nav * @return string */ function twentyeleven_get_first_url() { - $has_url = function_exists( 'get_the_url' ) ? get_the_url() : false; + $has_url = function_exists( 'get_the_post_format_url' ) ? get_the_post_format_url() : false; if ( ! $has_url ) $has_url = twentyeleven_url_grabber(); diff --git a/wp-content/themes/twentythirteen/content-audio.php b/wp-content/themes/twentythirteen/content-audio.php index 984f9c33ac..e4ee254b51 100644 --- a/wp-content/themes/twentythirteen/content-audio.php +++ b/wp-content/themes/twentythirteen/content-audio.php @@ -21,7 +21,7 @@
- +
diff --git a/wp-content/themes/twentythirteen/content-chat.php b/wp-content/themes/twentythirteen/content-chat.php index 75cd2060d0..7d2d7206f3 100644 --- a/wp-content/themes/twentythirteen/content-chat.php +++ b/wp-content/themes/twentythirteen/content-chat.php @@ -20,7 +20,7 @@
- + '', 'link_before' => '', 'link_after' => '' ) ); ?>
diff --git a/wp-content/themes/twentythirteen/content-video.php b/wp-content/themes/twentythirteen/content-video.php index deabc081c0..821b64146e 100644 --- a/wp-content/themes/twentythirteen/content-video.php +++ b/wp-content/themes/twentythirteen/content-video.php @@ -10,7 +10,7 @@
>
- +
diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index bea0fac289..0feec859e4 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -440,7 +440,7 @@ endif; * @return string URL */ function twentythirteen_get_link_url() { - $has_url = get_the_url(); + $has_url = get_the_post_format_url(); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } diff --git a/wp-includes/media.php b/wp-includes/media.php index ab2cf3e334..05371e04b7 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2031,7 +2031,7 @@ wp_embed_register_handler( 'wp_video_embed', '#https?://.+?\.(' . join( '|', wp_ * @param WP_Post $post Optional. Used instead of global $post when passed. * @return string */ -function get_the_media( $type, &$post = null ) { +function get_the_post_format_media( $type, &$post = null ) { global $wp_embed; if ( empty( $post ) ) @@ -2118,8 +2118,8 @@ function get_the_media( $type, &$post = null ) { * @since 3.6.0 * */ -function the_video() { - echo get_the_media( 'video' ); +function the_post_format_video() { + echo get_the_post_format_media( 'video' ); } /** * Output the first audio in the current (@global) post's content @@ -2127,8 +2127,8 @@ function the_video() { * @since 3.6.0 * */ -function the_audio() { - echo get_the_media( 'audio' ); +function the_post_format_audio() { + echo get_the_post_format_media( 'audio' ); } /** @@ -2360,7 +2360,7 @@ function get_post_gallery_images( $post_id = 0 ) { * @param string $attached_size If an attached image is found, the size to display it. * @param WP_Post $post Optional. Used instead of global $post when passed. */ -function get_the_image( $attached_size = 'full', &$post = null ) { +function get_the_post_format_image( $attached_size = 'full', &$post = null ) { if ( empty( $post ) ) $post = get_post(); @@ -2435,6 +2435,6 @@ function get_the_image( $attached_size = 'full', &$post = null ) { * * @param string $attached_size If an attached image is found, the size to display it. */ -function the_image( $attached_size = 'full' ) { - echo get_the_image( $attached_size ); +function the_post_format_image( $attached_size = 'full' ) { + echo get_the_post_format_image( $attached_size ); } \ No newline at end of file diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index 0b159e2ca8..0fc45ea31d 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -574,7 +574,7 @@ function get_content_chat( &$content, $remove = false ) { * @param int $id Optional. Post ID * @return array */ -function get_the_chat( $id = 0 ) { +function get_the_post_format_chat( $id = 0 ) { $post = empty( $id ) ? clone get_post() : get_post( $id ); if ( empty( $post ) ) return array(); @@ -592,13 +592,13 @@ function get_the_chat( $id = 0 ) { * * @since 3.6.0 * - * @uses get_the_chat() + * @uses get_the_post_format_chat() * * @print HTML */ -function the_chat() { +function the_post_format_chat() { $output = '
'; - $stanzas = get_the_chat(); + $stanzas = get_the_post_format_chat(); foreach ( $stanzas as $stanza ) { foreach ( $stanza as $row ) { @@ -673,7 +673,7 @@ function get_content_url( &$content, $remove = false ) { * @param int $id Optional. Post ID. * @return string A URL, if found. */ -function get_the_url( $id = 0 ) { +function get_the_post_format_url( $id = 0 ) { $post = empty( $id ) ? get_post() : get_post( $id ); if ( empty( $post ) ) return ''; @@ -681,11 +681,11 @@ function get_the_url( $id = 0 ) { if ( in_array( get_post_format( $post->ID ), array( 'link', 'quote' ) ) ) { $meta = get_post_format_meta( $post->ID ); if ( ! empty( $meta['url'] ) ) - return apply_filters( 'get_the_url', esc_url_raw( $meta['url'] ), $post ); + return apply_filters( 'get_the_post_format_url', esc_url_raw( $meta['url'] ), $post ); } if ( ! empty( $post->post_content ) ) - return apply_filters( 'get_the_url', get_content_url( $post->post_content ), $post ); + return apply_filters( 'get_the_post_format_url', get_content_url( $post->post_content ), $post ); } /** @@ -694,8 +694,8 @@ function get_the_url( $id = 0 ) { * @since 3.6.0 *. */ -function the_url() { - echo esc_url( get_the_url() ); +function the_post_format_url() { + echo esc_url( get_the_post_format_url() ); } /** diff --git a/wp-includes/query.php b/wp-includes/query.php index 03303879ed..e42404ce68 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3697,17 +3697,17 @@ function setup_postdata($post) { if ( $format && in_array( $format, array( 'image', 'audio', 'video' ) ) ) { switch ( $format ) { case 'image': - get_the_image( 'full', $post ); + get_the_post_format_image( 'full', $post ); if ( isset( $post->split_content ) ) $split_content = $post->split_content; break; case 'audio': - get_the_media( 'audio', $post ); + get_the_post_format_media( 'audio', $post ); if ( isset( $post->split_content ) ) $split_content = $post->split_content; break; case 'video': - get_the_media( 'video', $post ); + get_the_post_format_media( 'video', $post ); if ( isset( $post->split_content ) ) $split_content = $post->split_content; break;