WordPress.org

Make WordPress Core

Ticket #16642: test-remove-filter.php

File test-remove-filter.php, 415 bytes (added by scribu, 3 years ago)
Line 
1<?php
2
3// Just drop this file in your mu-plugins filter and go to the admin dashboard
4
5function some_callback( $value ) {
6        return 'filtered';
7}
8add_filter( 'some_filter', 'some_callback' );
9
10function apply_some_filter() {
11        $value = 'raw';
12        $value = apply_filters( 'some_filter', $value );
13
14        var_dump( $value );
15}
16add_action( 'admin_notices', 'apply_some_filter' );
17
18remove_filter( 'some_filter', 'some_callback' );