A
A
Alexey2021-10-01 12:57:53
WordPress
Alexey, 2021-10-01 12:57:53

How to use composer libraries in wordpress?

Hello! I'm writing a wordpress plugin that needs to use a library that is only installed with composer. How to deal with this, After all, the plugin is an independent entity, and there are no composer libraries in wordpress. Also, install it in the root folder, where vendo and composer.phar will appear, or is it better to install your own plugin libraries for each plugin?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zettabyte, 2021-10-01
@Zettabyte

Can't you use composer to pull all the files you need to your working machine when developing the plugin, then transfer them to the plugin folder, and use the appropriate paths?
When updating the plugin, also update the files downloaded by the composer, and pack them into .ZIP with the new version.
I haven't tried it for WordPress, but downloaded files can definitely be manipulated in Drupal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question