Ticket #2445: txfx-empty-means-closed.php
| File txfx-empty-means-closed.php, 421 bytes (added by markjaquith, 6 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Patch for WP 2.0.1 to allow comments/ping status to be set as "closed" on first post save/publish |
| 4 | Author: Mark Jaquith |
| 5 | Author URL: http://txfx.net/ |
| 6 | */ |
| 7 | |
| 8 | function txfx_empty_means_closed($status) { |
| 9 | var_dump($status); |
| 10 | die(); |
| 11 | if ( empty($status) ) |
| 12 | $status = 'closed'; |
| 13 | } |
| 14 | |
| 15 | add_filter('comment_status_pre', 'txfx_empty_means_closed', 1); |
| 16 | add_filter('ping_status_pre', 'txfx_empty_means_closed', 1); |
| 17 | ?> |
