From 2b56623d89f474cc6777c0a2ddc7b10e7ba8caeb Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sat, 13 Jan 2018 01:10:56 +0000 Subject: [PATCH] Formatting: Do not run formatting and texturization on author bios. Removes the formatting and texturization added to author bios in #40040 due to back-compatibility concerns. Reverts [41172], [41173]. Props 0x6f0, rabmalin for review. Fixes #42578. git-svn-id: https://develop.svn.wordpress.org/trunk@42441 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-filters.php | 2 +- tests/phpunit/tests/user/author.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index c1f6f673e1..53f1d7b247 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -124,7 +124,7 @@ foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 's } // Format text area for display. -foreach ( array( 'term_description', 'get_the_author_description', 'get_the_post_type_description' ) as $filter ) { +foreach ( array( 'term_description', 'get_the_post_type_description' ) as $filter ) { add_filter( $filter, 'wptexturize' ); add_filter( $filter, 'convert_chars' ); add_filter( $filter, 'wpautop' ); diff --git a/tests/phpunit/tests/user/author.php b/tests/phpunit/tests/user/author.php index d8bdf37a39..669ff72d84 100644 --- a/tests/phpunit/tests/user/author.php +++ b/tests/phpunit/tests/user/author.php @@ -56,18 +56,18 @@ class Tests_User_Author_Template extends WP_UnitTestCase { $this->assertEquals( 'test_author', get_the_author_meta( 'user_login' ) ); $this->assertEquals( 'test_author', get_the_author_meta( 'display_name' ) ); - $this->assertEquals( '

test_author

', trim( get_the_author_meta( 'description' ) ) ); + $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) ); $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) ); add_user_meta( self::$author_id, 'user_description', 'user description' ); $this->assertEquals( 'user description', get_user_meta( self::$author_id, 'user_description', true ) ); // user_description in meta is ignored. The content of description is returned instead. // See #20285 $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) ); - $this->assertEquals( '

test_author

', trim( get_the_author_meta( 'description' ) ) ); + $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) ); update_user_meta( self::$author_id, 'user_description', '' ); $this->assertEquals( '', get_user_meta( self::$author_id, 'user_description', true ) ); $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) ); - $this->assertEquals( '

test_author

', trim( get_the_author_meta( 'description' ) ) ); + $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) ); $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) ); }