Make WordPress Core

Ticket #5117: kill_one_message.php

File kill_one_message.php, 603 bytes (added by strider72, 16 years ago)

example plugin showing filter usage

Line 
1<?php
2/*
3Plugin Name: Kill This 'Not Checked' Message
4Description: Removes the "Not Checked for Updates" message <em>for this plugin only</em> by adding a filter to 'plugin_updates_unknown'.  Of course we could change it to something else instead.
5Version: 0.1
6Date: 2008-06-14
7Author: Stephen Rider
8Author URI: http://striderweb.com/
9*/
10
11add_filter('plugin_updates_unknown','kill_this_unknown', 10, 2);
12
13function kill_this_unknown($output, $file) {
14        static $this_plugin;
15        if( !$this_plugin ) $this_plugin = plugin_basename(__FILE__);
16       
17        if( $file == $this_plugin ) $output = '';
18        return $output;
19}
20
21?>