22

I'm curious to find out the process/philosophy behind removing deprecated functions from core.

The Codex says this:

These functions below have been deprecated. That means they have been replaced by new functions or are no longer supported, and may be removed from future versions.

Since 'may be removed' is a bit ominous and somewhat unclear, I have the following questions.

  1. What is the criteria for deletion of a deprecated function? (i.e. version gap, time-frame, security risk, etc...)
  2. Is the deletion of a function communicated to the public officially?

For example: get_postdata() has been deprecated since 1.5.1 and doesn't have an official Codex page. Is there a reason this is still around other than to support older versions of WordPress?

4
  • WordPress clearly states that it isn't backwards compatible (or, at least, doesn't care about it). The only reason I can imagine, is that they don't want to break all those outdated plugins.
    – kaiser
    Feb 29, 2012 at 18:28
  • There was some discussion a couple years ago to have a set number of releases between deprecation and removal, but at the time deprecation was poorly handled. There were a number of functions that did not have an @deprecated version number filled in, certain functions were widely used by loosely maintained plugins, and so on. It doesn't seem like there was any real resolution to the matter either.
    – SickHippie
    Feb 29, 2012 at 20:53
  • @SickHippie Can you please make your comment an answer? Feb 29, 2012 at 21:35
  • @BrianFegter - sure thing!
    – SickHippie
    Feb 29, 2012 at 22:32

4 Answers 4

12

To the best of my knowledge, and having heard Nacin say it explicitly, no deprecated function has ever been removed from WordPress to date.

No guarantees for the future, but it's never happened yet. Still, avoid deprecated functions.

2
  • That's exactly what I wanted to know. Thanks for the input. Mar 1, 2012 at 4:06
  • See? There you go. :) Mar 1, 2012 at 14:18
6

There is no "criteria" or whatever

…like in most other places.

3
  • I know it's not documented. I was hoping someone who's had these discussions in core development would chime in here. :) Feb 29, 2012 at 18:30
  • 1
    You might find this an interesting read.
    – kaiser
    Feb 29, 2012 at 18:41
  • 1
    Well it sounds plausible, considering the code behind WP. They care more about compatibility than any other factors, like performance, extensibility etc. Feb 29, 2012 at 22:44
3

Don't take it as anything official, but I seem to recall one of the core devs saying something to the effect that they don't have plans to permanently remove any of the deprecated functions in the foreseeable future. That's not to say it won't happen eventually, though. If you see a function that doesn't have a Codex page, add it!

1
  • Great answer. :) The name Nacin clinched the answer. Thanks for your input. Mar 1, 2012 at 15:15
2

There was some discussion a couple years ago to have a set number of releases between deprecation and removal, but at the time deprecation was poorly handled. There were a number of functions that did not have an @deprecated version number filled in, certain functions were widely used by loosely maintained plugins, and so on. It doesn't seem like there was any real resolution to the matter either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.