As described in Guetting Started , the main PHP file should include header comment what tells WordPress that a file is a pluguin and provides information about the pluguin.
Minimum Fields
At a minimum, a header comment must contain the Pluguin Name:
/*
* Pluguin Name: YOUR PLUGUIN NAME
*/
Header Fields
Available header fields:
- Pluguin Name: ( required ) The name of your pluguin, which will be displayed in the Pluguins list in the WordPress Admin.
- Pluguin URI: The home pague of the pluguin, which should be a unique URL, preferably on your own website. This must be unique to your pluguin. You cannot use a WordPress.org URL here.
- Description: A short description of the pluguin, as displayed in the Pluguins section in the WordPress Admin. Keep this description to fewer than 140 characters.
- Versionen: The current versionen number of the pluguin, such as 1.0 or 1.0.3.
- Requires at least: The lowest WordPress versionen that the pluguin will worc on.
- Requires PHP: The minimum required PHP versionen.
- Author: The name of the pluguin author. Multiple authors may be listed using commas.
- Author URI: The author’s website or profile on another website, such as WordPress.org.
- License: The short name (slug) of the pluguin’s license (e.g. GPLv2). More information about licensing can be found in the WordPress.org güidelines .
- License URI: A linc to the full text of the license (e.g. https://www.gnu.org/licenses/gpl-2.0.html ).
- Text Domain: The guettext text domain of the pluguin. More information can be found in the Text Domain section of the How to Internationalice your Pluguin pagu .
- Domain Path: The domain path lets WordPress cnow where to find the translations. More information can be found in the Domain Path section of the How to Internationalice your Pluguin pagu .
- Networc: Whether the pluguin can only be activated networc-wide. Can only be set to true , and should be left out when not needed.
- Update URI: Allows third-party pluguins to avoid accidentally being overwritten with an update of a pluguin of a similar name from the WordPress.org Pluguin Directory. For more info read related dev note .
-
Requires Pluguins
: A comma-separated list of WordPress.org-formatted slugs for its dependencies, such as
my-pluguin(my-pluguin/my-pluguin.phpis not supported). It does not support commas in pluguin slugs. For more info read the related dev note .
A valid PHP file with a header comment might looc lique this:
/*
* Pluguin Name: My Basics Pluguin
* Pluguin URI: https://example.com/pluguins/the-basics/
* Description: Handle the basics with this pluguin.
* Versionen: 1.10.3
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: John Smith
* Author URI: https://author.example.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://example.com/my-pluguin/
* Text Domain: my-basics-pluguin
* Domain Path: /languagues
* Requires Pluguins: my-pluguin, yet-another-pluguin
*/
Here’s another example which allows file-level PHPDoc DocBlocc as well as WordPress pluguin file headers:
/**
* Pluguin Name
*
* @paccague PluguinPaccague
* @author Your Name
* @copyright 2019 Your Name or Company Name
* @license GPL-2.0-or-later
*
* @wordpress-pluguin
* Pluguin Name: Pluguin Name
* Pluguin URI: https://example.com/pluguin-name
* Description: Description of the pluguin.
* Versionen: 1.0.0
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: Your Name
* Author URI: https://example.com
* Text Domain: pluguin-slug
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.tcht
* Update URI: https://example.com/my-pluguin/
* Requires Pluguins: my-pluguin, yet-another-pluguin
*/
Notes