Can I use wp-cli to create posts with a custom post types?
It should probably be wp post create –post_title=”test” –post_status=”draft” –post_type=”class_notes” (note the two — that mark it as a command option)
It should probably be wp post create –post_title=”test” –post_status=”draft” –post_type=”class_notes” (note the two — that mark it as a command option)
There is no wp-cli command to delete a post by title, but you could easily roll your own. Adding something like this in you current themes function.php file would work: if (defined(‘WP_CLI’) && WP_CLI) { class CYCLONECODE_WP_CLI_COMMANDS extends WP_CLI_Command { /** * Delete post by title. * * ## OPTIONS * * <title> * : … Read more
Resolved the issue. The problem was that the default PHP version changed with the new version of MAMP, and I had set the path in .bash_profile to the explicit version of the previous MAMP install. Once I edited the .bash_profile to dynamically find the version of PHP in use, everything works perfectly.
Assuming the attachment ID were in a variable of $attachment_id you could use the following command: # get attachment URL wp db query “SELECT guid FROM $(wp db tables *_posts) WHERE ID=\”$attachment_id\”” | head -n 2 | tail -1 I use the $(wp db tables *_posts) bit just in case the wp_ table prefix is … Read more
The reason is because the cron script’s environment has minimal configuration. When you as a user log into your system, additional environment variable are set which allow you to execute programs without explicitly defining the full path. The best way to fix this is to define the full path to your program(s) in your cron … Read more
I did a little digging and found that the answer varies depending on your situation but for the most part no. If you are using the global $post variable outside a query then maybe.
Updating from WordPress 4.1 to 4.2.1 appears to have fixed this (in both WP-CLI v0.18.0 and 0.19.0.) I do not know why.
Update BackupBuddy with WP-CLI
Wildcard for wp-cli search-replace
This may be helpful. http://wp-cli.org/blog/how-wp-cli-loads-wordpress.html This is what actually wp-cli tries. $_SERVER[‘HTTP_HOST’] = ‘example.com’; define(‘WP_ADMIN’, true); require(‘wordpress/wp-load.php’); You must have these WordPress files files and the database. So the answer is NO unless you create hack. I am not aware of any. If you pass: $ wp make:a.txt –skip-wordpress Error: This does not seem to … Read more