Information Technology Reference
In-Depth Information
IV
// save
//
update_option(
'followme_settings',
$_
);
Then, once you've clicked Submit, update the snippets:
die(“<script>document.location.href =
'{$_SERVER['HTTP_REFERER']}&saved=settings:” . time() . “';</script>”);
}
// operation report detected
if (@$_GET['saved']) {
list($saved, $ts) = explode(':', $_GET['saved']);
if (time() - $ts < 10) {
echo '<div class=”updated”><p>';
switch ($saved) {
case 'settings' :
echo 'Settings saved.';
break;
}
echo '</p></div>';
}
}
// read the settings
//
$followme_settings = (array) get_option('followme_settings');
?>
This is the end of the PHP script. Looking further down the file, this plug-in isn't finished, though. It
includes what appears to be a JavaScript implementation of the plug-in, which is beyond our scope.
This is followed by the actual definition of the Settings form, existing of pretty much standard HTML.
Once you've written your plug-in, it's time to show it off to the world. WordPress is, of course, all
about sharing.
Submitting to the WordPress Plugin Directory
You want to get your plug-in into the hands and blogs of millions of users, don't you? Perhaps the
best and easiest way to do that is to get your plug-in into the WordPress Plugin Directory. You
already know how easy WordPress makes it to search for and install plug-ins from the directory, so
why wouldn't you want to add your new program to the list?
Search WWH ::




Custom Search