| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | Plugin Name: Show do_action warning |
|---|
| 5 | Description: This is not just a plugin, it represents a constant frustration faced by Chris Jean for the past three months. |
|---|
| 6 | Author: Chris Jean |
|---|
| 7 | Version: 1.0.0 |
|---|
| 8 | Author URI: http://gaarai.com/ |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | error_reporting( E_ALL ); |
|---|
| 12 | ini_set( 'display_errors', 1 ); |
|---|
| 13 | |
|---|
| 14 | add_action( 'do_nothing', 'this_does_nothing' ); |
|---|
| 15 | |
|---|
| 16 | function this_does_nothing( $argument ) { |
|---|
| 17 | // Do nothing |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | $this_works_1 = 'value'; |
|---|
| 21 | $this_works_2 = array(); |
|---|
| 22 | $this_works_3 = array( '1', '2', '3' ); |
|---|
| 23 | $this_works_4 = (object) array( 'name' => 'value' ); |
|---|
| 24 | |
|---|
| 25 | $produces_a_warning = array( 'name' => 'value' ); |
|---|
| 26 | |
|---|
| 27 | do_action( 'do_nothing', $this_works_1 ); |
|---|
| 28 | do_action( 'do_nothing', $this_works_2 ); |
|---|
| 29 | do_action( 'do_nothing', $this_works_3 ); |
|---|
| 30 | do_action( 'do_nothing', $this_works_4 ); |
|---|
| 31 | do_action( 'do_nothing', $produces_a_warning ); |
|---|
| 32 | |
|---|
| 33 | ?> |
|---|