How to use WordPress methods (themes, plugins, context) with Behat?
How to use WordPress methods (themes, plugins, context) with Behat?
How to use WordPress methods (themes, plugins, context) with Behat?
How do I configure wordpress structure for development using git and composer
WordPress composer issues
WordPress doesn’t quite have a practice of localizing something that isn’t core/plugin/theme. My educated guess would be that it will work just fine with same concepts, but you will have to write custom loading logic. Use lower level load_textdomain(), since higher level functions are meant for plugins/themes specifically. As long as you determine and load … Read more
Composer generates the autoloader for you. Thus, you don’t need to require a specific file from vendor packages. All you need to do is require the composer autoloader: Change require_once dirname(__FILE__) . ‘/vendor/Frozensheep/RightmoveADF/RightmoveADF.php’; to require_once plugin_dir_path(__FILE__) . ‘vendor/autoload.php’; In some cases, classes still not be found. Re-generate the composer autoloader by $ composer dump-autoload. Usually, … Read more
The solution was pretty simple, actually. I just needed to specify the path of the php-cli that I wanted to use and where the composer.phar file was located. So I added the following to my depoly.rb script for Capistrano: SSHKit.config.command_map[:composer] = “/usr/local/php56/bin/php-cli ~/composer.phar”
In order for WordPress to recognize a plugin it needs to be in the correct plugins folder. In an usual installation this is wp-content/plugins/ If you use wpackagist.org, a working example would be this composer.json: { “repositories”: [ { “type”: “composer”, “url”: “https://wpackagist.org” } ], “require”: { “wpackagist-plugin/broken-link-checker”: “*”, “wpackagist-theme/twentyseventeen”: “*” } } wpackagist-plugin signals … Read more
On your plugin activation hook method you can check if CMB plugin is installed and/or activated. You can check this using the following methods: is_plugin_active(): only available from within the admin pages function_exists() or class_exists(): available anywhere once they are PHP core methods If CMB is not installed, you can throw an error message in … Read more
You can do whatever suits your needs, such as still using composer but configuring your implementation to place the directories back into the root along with core, however the primary purpose in having core stand-alone from other directories is for separation of concerns that are not dependant upon one another sharing the same path. The … Read more
WordPress with Composer and different plugins for dev/live.