It is said that deprecated functions used in plugins & themes can crash a wordress website while upgrading to newer version, I want to see an example of deprecated function that can cause a crash.
Can someone show me an example?
Many Thanks!
It is said that deprecated functions used in plugins & themes can crash a wordress website while upgrading to newer version, I want to see an example of deprecated function that can cause a crash.
Can someone show me an example?
Many Thanks!
The following files hold the deprecated functions:
~/wp-includes/deprectated.php
~/wp-includes/pluggable-deprectated.php
Take a look at them and then through their replacement functions, where the calls to _deprecated_function()
happen.
Normally a crash shouldn't happen. In the "real" PHP world, you'd get an E_DEPRECATED
Warning. In WordPress you'll get a trigger_error()
return caused by _deprecated_function()
calls. The second trigger_error()
argument isn't used, so it defaults to E_USER_NOTICE
and won't stop your application from running.
You can turn this off either by using define( 'WP_DEBUG', false );
or by using a MU-Plugin that sets the filter to false:
<?php
defined('ABSPATH') or exit;
/** Plugin Name: (#105686) Turn off deprecated Warnings */
add_filter( 'deprecated_function_trigger_error', '__return_false' );
E_NOTICE
, not an E_ERROR
. The only thing I could imagine is that it echos inside some call where nothing should echo. For example during plugin activation. Just update your question with a real world example. So far you're too abstract.
– kaiser
Jul 8 '13 at 10:48