Skip to content

Commit bd4da5d

Browse files
authored
Merge pull request #542 from WinsleyJ/patch-1
Update how-to-create-custom-plugins.md
2 parents 94d7768 + 3f4a6db commit bd4da5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

how-to-create-custom-plugins.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## How to create a custom plugin:
1+
# How to create a custom plugin:
22

33
If you want to create your plugins, WP-CLI has a powerful scaffold command that allows us to generate starter code. In this guide we will see how to generate starter code for a basic plugin.
44

5-
### Step 1 - Scaffold the plugin files
5+
## Step 1 - Scaffold the plugin files
66

77
The following command uses several options to lets us specify the plugin slug, its name, description, author name and uri as well as the plugin uri. You can replace the values passed to the options below to customize the plugin based on your needs.
88

@@ -34,7 +34,7 @@ Unless you use the --skip-tests flag the following files are always generated:
3434
- `tests/test-sample.php` is a sample file containing test cases.
3535
- `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.
3636

37-
### Step 2 - create a custom post type:
37+
## Step 2 - create a custom post type:
3838

3939
We can now use the scaffold command again to add a custom post type inside our new plugin using the `wp scaffold post-type` command.
4040

@@ -43,7 +43,7 @@ We can now use the scaffold command again to add a custom post type inside our n
4343
Success: Created '/wpcli-demo-plugin/post-types/books.php'.
4444
```
4545

46-
### Step 3 - Write code inside the main file:
46+
## Step 3 - Write code inside the main file:
4747

4848
The main plugin file `wpcli-demo-plugin.php` is the starting point that we can use to write our plugin logic.
4949

@@ -57,7 +57,7 @@ and under the line saying "your code starts here" add the following:
5757
require('post-types/books.php');
5858
```
5959

60-
### Step 4 - Activate the plugin
60+
## Step 4 - Activate the plugin
6161

6262
You can now use two wp-cli commands to check the list of plugins and activate your newly created plugin.
6363
`wp plugin list` and `wp plugin activate`. The first command lists all plugins installed while the second

0 commit comments

Comments
 (0)