WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 23 months ago

Last modified 17 months ago

#40040 closed enhancement (wontfix)

Run wpautop on author bio

Reported by: henry.wright Owned by: 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 2 years ago.
40040.diff (606 bytes) - added by henry.wright 2 years ago.
40040.1.diff (2.5 KB) - added by henry.wright 2 years ago.
40040.2.diff (2.4 KB) - added by henry.wright 2 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
2 years ago

#1 @henry.wright
2 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.


2 years ago

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


2 years ago

#4 @johnbillion
2 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
2 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
2 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.


2 years ago

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


2 years ago

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


2 years ago

#10 @henry.wright
2 years ago

  • Keywords dev-feedback removed

#11 @johnbillion
2 years ago

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

#12 @johnbillion
2 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
2 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
2 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
2 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
2 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
2 years ago

@henry.wright
2 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
2 years ago

  • Status changed from reopened to reviewing

#18 @johnbillion
23 months 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
20 months 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
20 months 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 20 months ago by Ov3rfly (previous) (diff)

#21 @mrahmadawais
20 months 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
20 months 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
19 months 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
19 months ago

Follow-up to revert this change: #42578

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


19 months ago

#26 @SergeyBiryukov
18 months 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.


17 months ago

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


17 months ago

Note: See TracTickets for help on using tickets.