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.