WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#11249 closed enhancement (fixed)

wpautop no longer a standalone function

Reported by: matt Owned by: matt
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

Something that generally annoys me is inter-file dependencies of wp-includes. I would like for each of the files to be self-contained so you can include one and get everything you need from it.

A good recent example of us breaking this is with formatting, and wpautop in particular. You can no longer include formatting.php and call that function without including all of WP because it relies on a function called get_shortcode_regex().

Here's a one-liner that makes wpautop independently useful again with a simple function_exists.

Attachments (1)

autop.diff (778 bytes) - added by matt 4 years ago.

Download all attachments as: .zip

Change History (8)

matt4 years ago

comment:1 scribu4 years ago

  • Milestone changed from 2.9 to 3.0
  • Type changed from defect (bug) to enhancement

comment:2 westi4 years ago

I doubt we can ever be in the situation where all wp-includes files are standalone and they all still have functionality unless we merge them all into one file.

We have interdependency so that we don't duplicate code.

comment:3 scribu4 years ago

  • Milestone 3.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

comment:4 matt4 years ago

  • Milestone set to 2.9
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Agreed with Westi, but there's still no point for this particular one. As the author of autop is was always designed to be standalone so there's no reason not to fix this. It's not even a good dependency, it's literally a wrapper for an echo. I'm happy to just commit this, and was going to, just wanted to post it as a bug in case there is any overwhelming reason not to or unintended side-effect.

comment:5 markjaquith4 years ago

I'm the one who put this in. I'm fine with function_exists as a quick and low-impact solution to the interdependency issue.

comment:6 azaozz4 years ago

(In [12302]) Separate the removal of <p> wrapping from shortcodes into another function and apply it with different filter, props miqrogroove, props mdawaffe, see #11257, see #11249

comment:7 matt4 years ago

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

This fixes this issue, thanks azaozz!

Note: See TracTickets for help on using tickets.