From c16129d3cf89d4f4bc0dd9cac9b4abb573d33fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Wed, 11 Mar 2015 20:00:26 +0000 Subject: [PATCH] Enable more flexibility for non-URL GUIDs. props stevenkword. fixes #31080. Built from https://develop.svn.wordpress.org/trunk@31726 git-svn-id: http://core.svn.wordpress.org/trunk@31707 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-filters.php | 1 + wp-includes/post-template.php | 9 ++++++++- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 57e02d6fab..14a48e5bfd 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -167,6 +167,7 @@ add_filter( 'comment_text_rss', 'ent2ncr', 8 ); add_filter( 'comment_text_rss', 'esc_html' ); add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); add_filter( 'the_author', 'ent2ncr', 8 ); +add_filter( 'the_guid', 'esc_url' ); // Misc filters add_filter( 'option_ping_sites', 'privacy_ping_filter' ); diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 4d54178ee2..427b0acf90 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -172,7 +172,14 @@ function get_the_title( $post = 0 ) { * @param int|WP_Post $id Optional. Post ID or post object. */ function the_guid( $id = 0 ) { - echo esc_url( get_the_guid( $id ) ); + /** + * Filter the escaped Global Unique Identifier (guid) of the post. + * + * @since 4.2.0 + * + * @param string $post_guid Escaped Global Unique Identifier (guid) of the post. + */ + echo apply_filters( 'the_guid', get_the_guid( $id ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 65d9f79942..d1f8dc7276 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31725'; +$wp_version = '4.2-alpha-31726'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.