johnpbloch / wordpress-core

Other
169 stars 40 forks source link

composer install wpackagist theme in wrong folder #30

Open celtic34fr opened 2 years ago

celtic34fr commented 2 years ago

Hi all,

I'm testing metabolism/wordpress-bundle-demo (latest issue with johnpbloch/wordpress-core: 5.8), and trying to install plugins and themes with composer. For plugins, it will be installed in public/wp-bundle/plugins, as configured in the composer.json file. But for the themes, I will create a new folder at the root of the project 'wp-content/themes / ...' with the new theme. I am under linux (Ubuntu 21.04 desktop edition) and to have the good behavior in the administration area, I must make a symbolic link to have the same operation as on the wordpress site. where I had to do: 1 / I copy the wp-content/themes folder to public/edition/wp-content/themes 2 / delete the themes folder in wp-content/ and replace it with a symbolic link from public/edition/wp-content/themes 3 / I copy the content of public/wp-bundle/plugins in public/edition/wp-content/plugins, and after deleting the plugins folder in public/wp-bundle 4 / create 2 symbolic links in public/wp-bundle from public/edition/ wp-content/plugins and public/edition/wp-content/themes Then everything works fine, but it's so much work to get this result.

Thank you in advance for your answer

Celtic34fr Beziers - France

loxK commented 1 year ago

You can configure it in composer.json.

"extra": {
    "wordpress-install-dir": "core",
    "installer-paths": {
      "content/mu-plugins/{$name}/": [
        "type:wordpress-muplugin"
      ],
      "content/plugins/{$name}/": [
        "type:wordpress-plugin"
      ],
      "content/themes/{$name}/": [
        "type:wordpress-theme"
      ]
    }
  }
celtic34fr commented 9 months ago

this the 'extra' configuration that i use without any problems in Wordpress Administration : "extra": { "symfony": { "allow-contrib": false, "require": "5.2.*" }, "installer-paths": { "public/wp-bundle/mu-plugins/{$name}/": [ "type:wordpress-muplugin" ], "public/wp-bundle/plugins/{$name}/": [ "type:wordpress-plugin" ], "public/wp-bundle/themes/{$name}/": [ "type:wordpress-theme" ], "public/edition/": [ "type:wordpress-core" ] } } With this configuration, I can manage plugins and themes directly in Wordpress Administration without use packages to install plugins or theme.