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

Using a Folder

Оглавление

While WordPress does allow plugins to be a single file, it is generally not good practice to use this method. Instead, it is standard practice to use a folder to contain your plugin. The vast majority of plugins will contain multiple files, such as PHP files, CSS and JavaScript assets, and other build files.

When creating a plugin, it should ideally match your plugin name. Plugin folder names should be hyphenated and lowercase. It should not contain spaces, underscores, uppercase letters, or nonalphanumeric characters. The plugin folder name must also match the plugin text domain when preparing your plugin for translations (see Chapter 11, “Internationalization”) if you plan to submit it to the official plugin repository.

Using the previous “Super Duper Forums” plugin as an example, its folder name should be super‐duper‐forums.

Professional WordPress Plugin Development

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