Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11249 closed enhancement (fixed)

wpautop no longer a standalone function

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


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 14 years ago.

Download all attachments as: .zip

Change History (8)

14 years ago

#1 @scribu
14 years ago

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

#2 @westi
14 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.

#3 @scribu
14 years ago

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

#4 @matt
14 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.

#5 @markjaquith
14 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.

#6 @azaozz
14 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

#7 @matt
14 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.