How to install WordPress with Composer?

Using roots Bedrock for a few years, I gladly recommend it. Core versions are all available and are synced by roots.io technical team. Using WordPress with composer would allow you to have dependencies (WP core, plugins, themes, and other PHP libs) all managed with composer versions. Bedrock will also ensure that no core file is … Read more

Install WordPress using PHP

Please check if PHP is running in safe mode. excel_shell is disabled when PHP is running in safe mode. You can check this running the phpinfo() function. Tip: You could make a install script in bash and execute that from PHP. This way it’s easier to test on the command line first, and then wrap … Read more

ignoring, hidding mu plugins when wp-cli is run

I’m the author of Mobile Smart Pro. I’m in the midst of testing WP-CLI with Mobile Smart Pro, and on line 27 of /wp-content/mu-plugins/ you should add the following test: if (!$mobile_smart) return $pluginList; So the section would look like: `function disablePlugins($pluginList) { if (is_admin()) return $pluginList; // only deactivate on front end global $mobile_smart; … Read more

undefined function apache_request_headers()

From quick search I cannot find calls of this function in neither WP core or WP CLI. From quick check of documentation for it it seems that support for it in CLI context is (relatively) recent — starting with PHP 5.5.7. You might want to check if your PHP up to date. Note that CLI … Read more

Find latest/published version of post using wp-cli

Answering my own question, the current revision has these properties as compared to revisions: The post_status will be “publish” not “inherit”. The post_parent will be 0 The post_type will be “post” not “revision”. Additionally, the ID of the current revision doesn’t change when you update the post; instead, the older version is given a new … Read more