#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)
Change History (32)
This ticket was mentioned in Slack in #core by henrywright. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by henrywright. View the logs.
7 years ago
#4
@
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
@
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 & 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() )
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
#11
@
7 years ago
- Component changed from General to Formatting
- Milestone changed from Awaiting Review to 4.9
#12
@
7 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 41172:
#13
@
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:
↓ 16
@
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.
#16
in reply to:
↑ 14
@
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 lackswpautop()
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.
@
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.
#19
@
7 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
@
7 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.
#21
@
7 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
@
7 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
@
7 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>
This ticket was mentioned in Slack in #forums by zoonini. View the logs.
7 years ago
#26
@
7 years ago
- Resolution changed from fixed to wontfix
Reverted in [42441] due to backward compatibility concerns.
40040.diff runs wptexturize, convert_chars, wpautop and shortcode_unautop on the author description field.