visit the plugin's website. Version: 1.1 Author: Brock Rogers Author URI: http://www.brockrogers.com/ License: GPL2 */ /* Copyright 2012 by 10T Web Design (email : brock@10twebdesign.com) * * This program is free software; you can distribute it and/or modify * it under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * A copy of the GNU General Public License, version 2, is located at * http://www.gnu.org/licenses/gpl-2.0.html . If not, please write to * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA. */ add_action('admin_menu','attnoco_menu'); add_action('add_attachment','attnoco_run'); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'attnoco_add_plugin_action_links' ); function attnoco_run() { if(get_option('attnoco-attachment-status')) { attnoco_process(get_option('attnoco-attachment-status')); } } function attnoco_process($status) { global $wpdb; $table = $wpdb->prefix . 'posts'; $sql = 'SELECT * FROM ' . $table . ' WHERE `post_type` = \'attachment\''; $results = $wpdb->get_results($sql); if($results) { foreach($results as $result) { $wpdb->update($table, array( 'comment_status' => $status, 'ping_status' => $status ), array( 'ID' => $result->ID ) ); } } } function attnoco_add_plugin_action_links( $links ) { return array_merge( array( 'settings' => 'Settings' ), $links ); } function attnoco_menu() { add_options_page('AttNoCo','AttNoCo','manage_options','attnoco_settings','attnoco_settings'); } function attnoco_settings_save() { if(get_option('attnoco-attachment-status')) { update_option('attnoco-attachment-status',$_POST['attachment-status']); } else { add_option('attnoco-attachment-status', $_POST['attachment-status']); } return '

Settings saved.

'; } function attnoco_settings() { ?>

AttNoCo

AttNoCo will, any time you upload a new media file to your WordPress database, change the comment and ping status of all of the media in the library to the status you set below.

If you find this plugin useful, please donate a little bit of money toward its development.