Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#40040 closed enhancement (wontfix)

Run wpautop on author bio

Reported by: henrywright's profile henry.wright Owned by: johnbillion's profile johnbillion
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.7
Component: Formatting Keywords: needs-unit-tests has-patch
Focuses: template Cc:

Description

The wpautop function replaces double line-breaks with paragraph elements. It's executed on various items of content. Post content and term descriptions (used in category descriptions) are some examples.

I believe the author bio would benefit from wpautop.

Attachments (4)

Screenshot 2017-03-06 at 02.19.23.png (7.2 KB) - added by henry.wright 7 years ago.
40040.diff (606 bytes) - added by henry.wright 7 years ago.
40040.1.diff (2.5 KB) - added by henry.wright 7 years ago.
40040.2.diff (2.4 KB) - added by henry.wright 7 years ago.
get_the_post_type_description() seems a more appropriate name than get_the_post_type_archive_description(). 40040.2.diff changes the name of the new function.

Download all attachments as: .zip

Change History (32)

@henry.wright
7 years ago

#1 @henry.wright
7 years ago

  • Keywords has-patch added

40040.diff runs wptexturize, convert_chars, wpautop and shortcode_unautop on the author description field.

This ticket was mentioned in Slack in #core by henrywright. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by henrywright. View the logs.


7 years ago

#4 @johnbillion
7 years ago

  • Focuses template added
  • Version changed from 4.7.2 to 4.7

Pending some testing by Henry as discussed at Open Source Sprint London.

#5 @henry.wright
7 years ago

  • Focuses template removed
  • Keywords dev-feedback added
  • Version changed from 4.7 to 4.7.2

Using the_archive_description() in archive.php will output:

  • a term description if the current page is example.com/category/slug (or example.com/tag/slug for example)
  • an author's bio if the current page is example.com/author/username

Support for author bio was added in 4.7.0.

The reason for this ticket is the output of the_archive_description() is now inconsistent.

The term description is run through 4 functions:

  • wptexturize
  • convert_chars
  • wpautop
  • shortcode_unautop

However, the author bio isn't run through these.

This results in the front end source code looking like this:

In example.com/category/slug:

<p>This is a term description &#038; convert_chars and wpautop have run on it</p>

In example.com/author/username:

This is an author bio & convert_chars and wpautop have not run on it

40040.diff will make the category, tag and author archive output of the_author_description() consistent.

Running the_author_description() through one of the 4 functions manually didn't change the output so if end-users are doing this nothing will change for them after the introduction of this patch.

  • wptexturize( the_author_description() )
  • convert_chars( the_author_description() )
  • wpautop( the_author_description() )
  • shortcode_unautop( the_author_description() )

#6 @johnbillion
7 years ago

  • Focuses template added
  • Version changed from 4.7.2 to 4.7

This ticket was mentioned in Slack in #core by henrywright. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by henrywright. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#10 @henry.wright
7 years ago

  • Keywords dev-feedback removed

#11 @johnbillion
7 years ago

  • Component changed from General to Formatting
  • Milestone changed from Awaiting Review to 4.9

#12 @johnbillion
7 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 41172:

Formatting: Add formatting and texturization to author descriptions so they match the formatting of term descriptions.

Props henry.wright

Fixes #40040

#13 @johnbillion
7 years ago

  • Keywords needs-unit-tests added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Pro tip for testing locally: Run the tests against the correct installation.

This broke Tests_User_Author_Template::test_get_the_author_meta()

#14 follow-up: @johnbillion
7 years ago

@henry.wright since #38487, a post type archive description cane be output by the_archive_description() too, but it also lacks wpautop() etc. Wanna knock up a patch?

I'll look at fixing the test mentioned above.

#15 @johnbillion
7 years ago

In 41173:

Formatting: Update the author description tests since the formatting change made in [41172].

See #40040

#16 in reply to: ↑ 14 @henry.wright
7 years ago

  • Keywords has-patch added

Replying to johnbillion:

@henry.wright since #38487, a post type archive description cane be output by the_archive_description() too, but it also lacks wpautop() etc. Wanna knock up a patch?

Sure! 40040.1.diff is my stab at it. I first created a function to get the post type archive description and make that description filterable. I then used the new filter in default-filters.php.

@henry.wright
7 years ago

@henry.wright
7 years ago

get_the_post_type_description() seems a more appropriate name than get_the_post_type_archive_description(). 40040.2.diff changes the name of the new function.

#17 @johnbillion
7 years ago

  • Status changed from reopened to reviewing

#18 @johnbillion
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 41232:

Formatting: Introduce get_the_post_type_description() to allow post type archive descriptions to be formatted the same as author and term archives.

Props henry.wright

Fixes #40040

#19 @afercia
6 years ago

Has this been mentioned in a dev notes blog post or elsewhere? Though minor, it's a breaking change and authors should have been informed. For a first report, see #42578.

#20 @Ov3rfly
6 years ago

More reports will probably follow for Twenty Sixteen 1.4, Twenty Fifteen 1.9, Twenty Thirteen 2.3, Twenty Twelve 2.4, Jetpack 5.5, etc.

Last edited 6 years ago by Ov3rfly (previous) (diff)

#21 @mrahmadawais
6 years ago

OK, this wpautop has broken so many themes. It has started inserting p tags on the Author bio which are not styled.

#22 @henry.wright
6 years ago

@johnbillion what are your thoughts? Themes must be supporting <p> tags in term descriptions but it seems they're often not supporting them in the author description.

#23 @rabmalin
6 years ago

Strange that this breaking change went to the core so silently. Even default themes have not been updated to fix this. Eg, in Twenty Twelve, there is <p><?php the_author_meta( 'description' ); ?></p>

#24 @johnbillion
6 years ago

Follow-up to revert this change: #42578

This ticket was mentioned in Slack in #forums by zoonini. View the logs.


6 years ago

#26 @SergeyBiryukov
6 years ago

  • Resolution changed from fixed to wontfix

Reverted in [42441] due to backward compatibility concerns.

This ticket was mentioned in Slack in #core by jeremyescott. View the logs.


6 years ago

This ticket was mentioned in Slack in #core by jeremyescott. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.