PluginProbe
QuadMenu – Mega Menu / 3.3.8
QuadMenu – Mega Menu v3.3.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / vendor / automattic / jetpack-composer-plugin / README.md

README.md in QuadMenu – Mega Menu 3.3.8, at vendor/automattic/jetpack-composer-plugin/README.md

47 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 # composer-plugin
2
3 This is a custom installer plugin for Composer to help with WordPress translation of Composer libraries intended for use as shared code in plugins and themes.
4
5 When this plugin is installed, libraries with `type` set to `jetpack-library` will be installed into `jetpack_vendor/` instead of the usual `vendor/`.
6 Also translation text domain information will be collected from such libraries and written to `jetpack_vendor/i18n-map.php`.
7
8 ## Use in a WordPress plugin or theme
9
10 This plugin needs to be put into the `require` section of your `composer.json` file in order to be used.
11
12 ```json
13 "require": {
14 "automattic/jetpack-composer-plugin": "*"
15 },
16 ```
17
18 You'll also want to set `extra.wp-plugin-slug` or `extra.wp-theme-slug` to the WordPress.org slug, which is also the textdomain for your plugin or theme's translations.
19
20 ```json
21 "extra": {
22 "wp-plugin-slug": "my-plugin"
23 },
24 ```
25
26 Finally, for the libraries' translations to work, you'll also want to require [](https://packagist.org/packages/automattic/jetpack-assetsautomattic/jetpack-assets](https://packagist.org/packages/automattic/jetpack-assets](https://packagist.org/packages/automattic/jetpack-assets)
27 and include something like the following in your initialization code just after you load the autoloader:
28 ```php
29 \Automattic\Jetpack\Assets::alias_textdomains_from_file( __DIR__ . '/jetpack_vendor/i18n-map.php' );
30 ```
31
32 ## Use by a library
33
34 A library that wants to be used in WordPress plugins or themes needs to set the `type` in `composer.json` to `jetpack-library`. The library package _should not_ itself include a dependency on automattic/jetpack-composer-plugin, although it may [](https://getcomposer.org/doc/04-schema.md#suggestsuggest](https://getcomposer.org/doc/04-schema.md#suggest](https://getcomposer.org/doc/04-schema.md#suggest) it.
35
36 All calls to `__()`, `_x()`, and other WordPress i18n functions should then use a textdomain unique to the library. This textdomain also needs to be declared in `composer.json` as `extra.textdomain`:
37 ```json
38 "extra": {
39 "textdomain": "my-library"
40 },
41 ```
42
43 ## License
44
45 composer-plugin is licensed under [](./LICENSE.txtGNU General Public License v2 (or later)](./LICENSE.txt](./LICENSE.txt)
46
47