Ticket #2445: txfx-empty-means-closed.php

File txfx-empty-means-closed.php, 421 bytes (added by markjaquith, 6 years ago)

Plugin for WP 2.0.1 to fix the issue

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