From 305fbe129d723677d2733b63525815e51174d1db Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 13 Nov 2010 09:45:57 +0000 Subject: [PATCH] Only a static class method or function can be used in an uninstall hook. props scribu, fixes #13786. git-svn-id: https://develop.svn.wordpress.org/trunk@16339 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/plugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index e7d3e83faf..b7f06464e6 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -656,9 +656,14 @@ function register_deactivation_hook($file, $function) { * @since 2.7 * * @param string $file - * @param callback $callback The callback to run when the hook is called. + * @param callback $callback The callback to run when the hook is called. Must be a static method or function. */ -function register_uninstall_hook($file, $callback) { +function register_uninstall_hook( $file, $callback ) { + if ( is_array( $callback ) && is_object( $callback[0] ) ) { + _deprecated_argument( __FUNCTION__, '3.1', __( 'Only a static class method or function can be used in an uninstall hook.' ) ); + return; + } + // The option should not be autoloaded, because it is not needed in most // cases. Emphasis should be put on using the 'uninstall.php' way of // uninstalling the plugin.