Skip to content

Commit

Permalink
Adds example to change the permalink structure (#50251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburridge authored May 2, 2023
1 parent 639e57e commit 272a57e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,23 @@ Success: Installed 1 of 1 plugins.
✔ Ran `plugin install custom-post-type-ui` in 'cli'. (in 6s 483ms)
```

#### Changing the permalink structure
You might want to do this to enable access to the REST API (`wp-env/wp/v2/`) endpoint in your wp-env environment. The endpoint is not available with plain permalinks.

**Examples**

To set the permalink to just the post name:

```
wp-env run cli "wp rewrite structure /%postname%/"
```

To set the permalink to the year, month, and post name:

```
wp-env run cli "wp rewrite structure /%year%/%monthnum%/%postname%/"
```

### `wp-env destroy`

```sh
Expand Down

0 comments on commit 272a57e

Please sign in to comment.