]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/plugin.php
Wordpress 3.1.1
[autoinstalls/wordpress.git] / wp-includes / plugin.php
index c87e4172262969c250bee55865de7294948c96af..0c10e242f52a97aef1ec8d6e5101a06280f8b409 100644 (file)
@@ -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] ) ) {
+               _doing_it_wrong( __FUNCTION__, __( 'Only a static class method or function can be used in an uninstall hook.' ), '3.1' );
+               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.
@@ -727,7 +732,6 @@ function _wp_call_all_hook($args) {
  * @param string $tag Used in counting how many hooks were applied
  * @param callback $function Used for creating unique id
  * @param int|bool $priority Used in counting how many hooks were applied.  If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise.
- * @param string $type filter or action
  * @return string|bool Unique ID for usage as array key or false if $priority === false and $function is an object reference, and it does not already have a uniqe id.
  */
 function _wp_filter_build_unique_id($tag, $function, $priority) {