You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: acorn/package-development.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
date_modified: 2025-10-06 17:00
2
+
date_modified: 2026-03-05 12:00
3
3
date_published: 2021-10-21 13:21
4
4
title: Developing Packages for Acorn
5
5
description: Use the Acorn Example Package as a template for creating custom packages and reusable functionality for WordPress with Laravel architecture.
@@ -24,6 +24,24 @@ We recommend referencing the [Laravel docs on Packages](https://laravel.com/docs
24
24
25
25
From the [roots/acorn-example-package](https://github.com/roots/acorn-example-package) repo, click the **Use this template** button to create a new repo with the template.
26
26
27
+
After cloning your new repo, run the configure script to replace the placeholder names with your own:
28
+
29
+
```shell
30
+
$ php configure.php
31
+
```
32
+
33
+
The script will prompt you for your vendor name, package name, namespace, and other details. You can also run it non-interactively:
To preview changes without modifying any files, use `--dry-run`:
40
+
41
+
```shell
42
+
$ php configure.php --dry-run
43
+
```
44
+
27
45
## Developing an Acorn package
28
46
29
47
Once your package is created, clone your new git repo somewhere on your machine that's accessible from a WordPress site with Acorn installed. To work on a package locally, you can require it by defining a new local repository from the `composer.json` file used for your site/theme:
@@ -58,6 +76,6 @@ $ wp acorn package:discover
58
76
roots/sage ....................... DONE
59
77
```
60
78
61
-
::: warning
62
-
We have plans to [automate replacing the placeholders in the example package](https://github.com/roots/acorn/issues/271) in the future
79
+
::: tip
80
+
If you haven't already, run `php configure.php` from the root of your package to replace the placeholder names
0 commit comments