piotrpress/wpml-composer

This composer plugin enables installation of WPML (WordPress Multilingual) plugin and its components.

v0.2.0 2024-12-11 16:56 UTC

This package is auto-updated.

Last update: 2024-12-11 16:56:39 UTC


README

This composer plugin enables installation of WPML (WordPress Multilingual) plugin and its components.

Example

$ composer require wpml/sitepress-multilingual-cms:*
$ composer require wpml/woocommerce-multilingual:*

NOTE: Package name can be any WPML component slug.

Installation

You need to follow these steps only once to install the plugin:

  1. Provide WPML user_id and subscription_key from your account:
$ composer config -g http-basic.wpml.org <user_id> <subscription_key>

NOTE: using -g option is recommended to keep credentials outside of project's files.

  1. Allow the plugin execution:
$ composer config -g allow-plugins.piotrpress/wpml-composer true
  1. Add the plugin as a global composer requirement:
$ composer global require piotrpress/wpml-composer

Usage

The WPML plugin and its addons have a type set to wordpress-plugin and can be installed in custom location using for example Composer Installers:

{
  "require": {
    "wpml/sitepress-multilingual-cms": "*",
    "wpml/woocommerce-multilingual": "*",
    "composer/installers": "^2.0"
  },
  "config": {
    "allow-plugins": {
      "composer/installers": true
    }
  },
  "extra": {
    "installer-paths": {
      "wp-content/plugins/{$name}/": [
        "type:wordpress-plugin"
      ]
    }
  }
}

Requirements

  • PHP >= 7.4 version.
  • Composer ^2.0 version.

License

MIT