Skip to content

roots/acorn-example-package

Acorn Example Package

Follow Roots Sponsor Roots

This repo can be used to scaffold an Acorn package. See the Acorn Package Development docs for further information.

Support us

Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.

Installation

You can install this package with Composer:

composer require vendor-name/example-package

When using this repository as a package scaffold, run the configure script after creating the package:

php configure.php

For automation or CI, you can run it non-interactively:

php configure.php --no-interaction --author-name="Your Name" --author-email="you@example.com" --vendor-slug="your-vendor" --vendor-namespace="YourVendor" --package-slug="your-package" --class-name="YourPackage" --package-description="Your package description"

To preview changes without writing files:

php configure.php --dry-run

You can publish the config file with:

$ wp acorn vendor:publish --provider="VendorName\ExamplePackage\Providers\ExampleServiceProvider"

Usage

From a Blade template:

@include('Example::example')

From WP-CLI:

$ wp acorn example

Community

Keep track of development and community news.

Sponsor this project

 

Contributors