Tracking deprecated functions

This evening I have added some changes for the upcoming WordPress v2.4 release which will help theme, plugin and site developers track down when they are using deprecated WordPress functions. This new functionality relies, in part, on the new WP_DEBUG flag being enabled before anything interesting happens. With the new flag enabled a USER_NOTICE php error will be raised for each call to a deprecated function and if a deprecated file is included by a plugin. The error messages include the replacement function name and the version in which the function was deprecated.

The changes also introduce a pair of new hooks, deprecated_function_run and deprecated_file_included, which could be used by a plugin to create a log of all the functions used and provide the developer with information of what files need updating to use the replacement functions. These new hooks will fire whenever a deprecated function/file is used even if WP_DEBUG is disabled to allow for a simple plugin to log the errors without triggering the actual error on a live site.

Props to docwhat and darkdragon/santosj for their work on this change.

2 Responses to “Tracking deprecated functions”

  1. [...] e le funzioni deprecate che potrebbero essere usate in un tema o un plugin in questo articolo  – “Tracking deprecated functions” – in [...]

  2. [...] the definition.Past compilations and collections include:Adam Brown – WordPress Hooks DatabasePeter Westwood covers “WordPress: Tracking Deprecated Functions”Taragana – WordPress 2.x Filters – Comprehensive List for Plugin and Theme [...]



d
go to dashboard
l
go to login
h
show/hide help
e
edit post/page
r
comment on post/page
m
go to moderate comments
esc
cancel
%d bloggers like this: