Читать книгу Professional WordPress Plugin Development - Brad Williams - Страница 31

Types of Plugins

Оглавление

WordPress features a few different types and statuses for plugins, as shown in Figure 1‐4. You need to understand the difference when administering and creating plugins for WordPress.


FIGURE 1‐4: Types and statuses for plugins

 Active: Plugin is active and running in WordPress.

 Inactive: Plugin is installed but not active. No code from the plugin is executed.

 Recently Active: A temporary status given to any plugin that has been recently deactivated.

 Must‐Use: All plugins installed in the wp‐content/mu‐plugins directory. All Must‐Use, or MU, plugins are loaded automatically. The only way to deactivate an MU plugin is to remove it completely from the directory.

 Drop‐ins: Core functionality of WordPress can be replaced by Drop‐in plugins. These plugins are specifically named PHP files located in the wp‐content directory. If WordPress detects one of these files, it will be automatically loaded and listed under the Drop‐in filter on the Plugin screen. Currently ten Drop‐in plugins are available.advanced‐cache.php: Advanced caching plugindb.php: Custom database classdb‐error.php: Custom database error messageinstall.php: Custom installation scriptmaintenance.php: Custom maintenance messageobject‐cache.php: External object cachesunrise.php: Advanced domain mappingblog‐deleted.php: Custom blog deleted messageblog‐inactive.php: Custom blog inactive messageblog‐suspended.php: Custom blog suspended message

The last four Drop‐in plugins are specific to the WordPress Multisite feature. A standard WordPress installation will have no use for these plugins.

When developing a new plugin, determine what type of plugin you want to create before you start the development process. Most plugins will be standard WordPress plugins, but occasionally you might need to create a Must‐Use or Drop‐in plugin.

Professional WordPress Plugin Development

Подняться наверх