diff --git a/wp-includes/meta.php b/wp-includes/meta.php index dfc0695818..e341bd2bcc 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -1162,6 +1162,16 @@ function unregister_meta_key( $object_type, $object_subtype, $meta_key ) { return new WP_Error( 'invalid_meta_key', __( 'Invalid meta key' ) ); } + $args = $wp_meta_keys[ $object_type ][ $object_subtype ][ $meta_key ]; + + if ( isset( $args['sanitize_callback'] ) && is_callable( $args['sanitize_callback'] ) ) { + remove_filter( "sanitize_{$object_type}_{$object_subtype}_meta_{$meta_key}", $args['sanitize_callback'] ); + } + + if ( isset( $args['auth_callback'] ) && is_callable( $args['auth_callback'] ) ) { + remove_filter( "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", $args['auth_callback'] ); + } + unset( $wp_meta_keys[ $object_type ][ $object_subtype ][ $meta_key ] ); // Do some clean up diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d4a2fcc07..64bf163f19 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta2-38039'; +$wp_version = '4.6-beta2-38040'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.