[wp-trac] [WordPress Trac] #28607: Make wpautop()'s $allblocks variable filterable
WordPress Trac
noreply at wordpress.org
Sat Jun 21 04:52:00 UTC 2014
#28607: Make wpautop()'s $allblocks variable filterable
--------------------------------------+-----------------------------
Reporter: walkinonwat3r | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version:
Severity: normal | Keywords:
Focuses: administration, template |
--------------------------------------+-----------------------------
'''The problem''': I'd like <img> tags to ''not'' be wrapped by <p> in
the_content().
I used to use a regex filter on the_content to achieve this, but looking
at the source for wpautop(), I think it would be much cleaner to
''prevent'' <img>s from being wrapped in the first place by making
$allblocks filterable.
The <p><img /></p> issue commonly causes formatting issues, and making the
block list filterable would let theme/plugin authors change this without
and other blocks without breaking stylesheets configured for images in
paragraphs.
Additionally, I think it's semantically cleaner for a standalone image,
since "The HTML <p> element (or HTML Paragraph Element) represents a
paragraph of text." https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/p
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28607>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list