Home Forums ACF PRO Installing ACF5 via Composer Reply To: Installing ACF5 via Composer

  • So the code above provided by @ihorvorotnov to hook on muplugins did not work for me but ffraenz/private-composer-installer that he suggested did to install the plugin via composer.

    In order to include the plugin in my theme, I first changed the package type to library, instead of wordpress-plugin, that way it installs in the vendor folder since I had to use composer within my theme (see below).

    Then I used this official resource and just replaced the paths with those that composer creates i.e., /vendor/advanced-custom-fields/advanced-custom-fields-pro/.

    The use-case is that I scaffold many projects the same way and it’s always been a PITA to have a scaffold that requires I install both Timber and ACF Pro to get up and running; I mean what’s the point of a scaffold if it doesn’t scaffold everything that’s needed.

    Since Timber is either installed as a WordPress plugin from WordPress (what I want to avoid) or via composer from within the theme and not as a "type": "wordpress-plugin", which means that it won’t install into wp-content/plugins/ annoyingly enough, either Yeoman would have to run two composer installs, one in the root directory of WordPress and the other from within the theme, or I had to figure out how to combine them. The easiest way is to include ACF Pro in the theme, plus I like that it is locked down since all my work is premium custom-tailored theme development.