diff --git a/docs/2.getting-started.md b/docs/2.getting-started.md index d6a88c5..00f9b8e 100644 --- a/docs/2.getting-started.md +++ b/docs/2.getting-started.md @@ -29,13 +29,44 @@ wp plugin install https://github.com/WordPress/abilities-api/releases/latest/dow } ``` +#### In a Composer-managed WordPress installation + +```jsonc +// composer.json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/WordPress/abilities-api.git" + }, + // ... other non-WPackagist repositories. + ], + "extra": { + "installer-paths": { + // This relative path should match your WordPress+Composer setup. + "wp-content/plugins/{$name}/": [ + "type:wordpress-plugin" + ] + // .. other paths. + } + } + // ... rest of your composer.json. +} +``` + +Then require the package in your project: + +```bash +composer require wordpress/abilities-api +``` + ### As a dependency Plugin authors and developers may wish to rely on the Abilities API as a dependency in their own projects, before it is merged into core. You can do that in one of the following ways. -#### As a Plugin Dependency (Recommended) +#### As a Plugin Dependency -The best way to ensure the Abilities API is available for your plugins is to include it as one of your `Requires Plugins` in your [Plugin header](https://developer.wordpress.org/plugins/plugin-basics/header-requirements/). For example: +The easiest way to ensure the Abilities API is available for your plugins is to include it as one of your `Requires Plugins` in your [Plugin header](https://developer.wordpress.org/plugins/plugin-basics/header-requirements/). For example: ```diff # my-plugin.php @@ -49,7 +80,7 @@ The best way to ensure the Abilities API is available for your plugins is to inc */ ``` -While this is enough to ensure the Abilities API is loaded before your plugin, if you need to ensure specific version requirements or provide users guidance on installing the plugin, you can use the methods described [later on](#checking-availability-with-code) +While this is enough to prevent your plugin from being activated if the Abilities API plugin is not available, it does not install the plugin for you. If you need to ensure specific version requirements or provide users guidance on installing the plugin, you can use the methods described [later on](#checking-availability-with-code) #### As a Composer dependency