Information Technology Reference
In-Depth Information
IV
The script begins with six lines, including the basic information the WordPress Plugin Directory
needs from each plug-in.
Plugin Name
Plugin URI —The home page for this plug-in
Description —A brief explanation telling your would-be users what your plug-in does and why
they need it
Author —Your name or handle
Version
Author URI —Your home page
Figure 15.4
Edit plug-ins
just like
themes in the
WordPress
plug-in editor.
Even if you don't want to be included in the Plugin Directory,
having this information in your plug-in is an excellent practice to
follow.
The real program begins with a couple of IF statements that
check for special conditions before the program should run.
ABSPATH is a constant in WordPress invoked when WordPress is
installed to a different directory than the blog URL. The program
runs when it finds both the WordPress files, and the plug-in
(Class followme) is activated.
if (!defined('ABSPATH')) {
return ;
}
tip
Although not required to be
included in the Plugin Directory,
it's very good to have explicit
licensing information in this ini-
tial information section. The
directory requires all plug-in
code to be released under a free
or open source license, compati-
ble with the GNU General Public
License—just as the WordPress
code itself is.
if (!class_exists('followme')) {
Search WWH ::




Custom Search