https://github.com/26b/wp-plugin
A WordPress plugin starter.
https://github.com/26b/wp-plugin
composer php7 wordpress wordpress-plugin
Last synced: 2 months ago
JSON representation
A WordPress plugin starter.
- Host: GitHub
- URL: https://github.com/26b/wp-plugin
- Owner: 26B
- License: gpl-3.0
- Created: 2017-08-05T23:58:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T00:01:37.000Z (over 7 years ago)
- Last Synced: 2025-10-03T23:54:58.154Z (9 months ago)
- Topics: composer, php7, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 61.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WP-Plugin
All you need to start creating a plugin for WordPress.
We aim to deliver a focus on the API features of WordPress and it's eventual use as a headless CMS, but feel free to use this base for any kind of plugin. It provides several features that will enable you to develop and test your code.
## Getting started
### Find and Replace
This project is a skeleton, so it has a bunch of keys that need to be replaced with values specific to your project.
For these changes, you should use the "Find and Replace" feature of your editor. Later there will be more options to this. Below you can find the table with the keys and their respective description, along with an example for the possible value.
| Key | Description | Example value |
| ------------------------ | ------------------------------------------------------------------- | ------------------------------------- |
| `[vendor_name]` | Your username or company name: no spaces | `26B` |
| `[plugin_name]` | See ["Planning Your Plugin – Pick a good name"][1] ([more info][2]) | `Foo Bar` |
| `[plugin_description]` | Description for the plugin ([more info][2]) | `A WordPress plugin starter.` |
| `[plugin_url]` | Plugin URL ([more info][2]) | `https://github.com/26B/wp-plugin` |
| `[initial_version]` | Version to start the plugin with ([more info][2]) | `1.0.0` |
| `[author_name]` | Author name ([more info][2]) | `Pedro Duarte` |
| `[author_url]` | Author URL ([more info][2]) | `https://github.com/xipasduarte` |
| `[text_domain]` | Text domain ([more info][2]) | `foo-bar` |
| `[composer_vendor]` | Your username, company or project name: lowercase and no spaces | `26b` |
| `[composer_name]` | Plugin identifier: usually the `[plugin_name]` in dash-case | `foo-bar` |
| `[namespace]` | Desired PHP namespace | `26B\WP\Plugin\FooBar` |
| `[autoload_psr_4]` | [PSR-4 autoload][3] for `[namespace]` | `26B\\WP\\Plugin\\FooBar\\` |
| `[autoload_tests_psr_4]` | [PSR-4 autoload][3] for `[namespace_tests]` | `26B\\WP\\Plugin\\FooBar\\Tests\\` |
[1]: https://developer.wordpress.org/plugins/wordpress-org/planning-your-plugin/#2-pick-a-good-name
[2]: https://developer.wordpress.org/plugins/the-basics/header-requirements/
[3]: https://getcomposer.org/doc/04-schema.md#psr-4
For further information on writing WordPress plugins refer to the [official documentation](https://developer.wordpress.org/plugins/).
### Run composer
After all of the changes don't forget to run `composer install` to have the dependencies load and the autoload built. (Without this your plugin will break.)