WordPress.org

Make WordPress Core

Changeset 16339


Ignore:
Timestamp:
11/13/2010 09:45:57 AM (10 years ago)
Author:
nacin
Message:

Only a static class method or function can be used in an uninstall hook. props scribu, fixes #13786.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/plugin.php

    r15829 r16339  
    657657 *
    658658 * @param string $file
    659  * @param callback $callback The callback to run when the hook is called.
    660  */
    661 function register_uninstall_hook($file, $callback) {
     659 * @param callback $callback The callback to run when the hook is called. Must be a static method or function.
     660 */
     661function register_uninstall_hook( $file, $callback ) {
     662    if ( is_array( $callback ) && is_object( $callback[0] ) ) {
     663        _deprecated_argument( __FUNCTION__, '3.1', __( 'Only a static class method or function can be used in an uninstall hook.' ) );
     664        return;
     665    }
     666
    662667    // The option should not be autoloaded, because it is not needed in most
    663668    // cases. Emphasis should be put on using the 'uninstall.php' way of
Note: See TracChangeset for help on using the changeset viewer.