WordPress.org

Make WordPress Core

Ticket #12492: 12492-example.php

File 12492-example.php, 576 bytes (added by chrisbliss18, 5 years ago)

Example plugin that shows bug

Line 
1<?php
2
3/*
4Plugin Name: 12492 Example Plugin
5Plugin URI: https://core.trac.wordpress.org/ticket/12492
6Description: This plugin shows the variable variable bug in remove_all_filters
7Author: Chris Jean
8Version: 1.0.0
9Author URI: http://gaarai.com/
10*/
11
12
13add_action( 'template_redirect', 'show_bug' );
14add_action( 'template_redirect', 'show_bug', 20 );
15add_action( 'template_redirect', 'show_bug', 30 );
16
17// Remove only the action(s) on the default priority
18remove_all_actions( 'template_redirect', 10 );
19
20function show_bug() {
21        echo "<h1>This should render twice.</h1>\n";
22}
23
24
25?>