Does wp post delete also delete metadata associated with posts?
In short, yes. However, if you run into an issue like custom fields or media hanging around, you could use: wp post meta delete
In short, yes. However, if you run into an issue like custom fields or media hanging around, you could use: wp post meta delete
If no –path is passed, WP-CLI defaults to the current directory and looks for the wp-includes/version.php file. So, make sure that the directory you’re in has such a file: $ ls wp-includes $ cat wp-includes/version.php $ wp core version
The main problem is that your wp_reset_init() method deals with too many things. It’s looking at the $_POST request, it’s performing database queries, and it’s performing redirects. You need to separate your concerns so you end up with a new method which only performs the database reset, and which accepts parameters rather than using $_POST … Read more
Assume we have a custom post type movie (slug) and a custom taxonomy cast (slug). 1) To find all movies starring Emily Watson, stored with the term slug emily-watson, we can do: wp post list –post_type=movie –cast=emily-watson to list all her movies. 2) To find all movies featuring Elizabeth Taylor or Richard Burton , stored … Read more
mu-plugins don’t get activated. They’re activated just by being in that folder.
Cloning a post via wp-cli is little trickier. It needs two steps: Create a file where save the information of post. Suppose, following command create a file named file.txt from hello post (id 1). In this case file.txt which save on root directory. wp post get 1 > file.txt Create new post from this file. … Read more
The simplest way via wp-cli that comes to mind (while it’s not supported yet as far as I can see) is something like: wp eval “update_option( ‘auto_update_plugins’, array_keys( get_plugins() ) );” that will update the auto_update_plugins option with the array of all plugin files to update. This should probably be extended further to only update … Read more
It’s as if you were trying to run: wp plugin status –path=$(/home/me/domains/example.com/public_html) because what’s inside the backticks get’s evaluated. Here’s a good reading about using backticks in the command line. Let me quote @rozcietrzewiacz: Backtick is not a quotation sign, it has a very special meaning. Everything you type between backticks is evaluated (executed) by … Read more
Try the –skip-plugins flag with the problematic commands. Just as you experienced I’ve had wp-cli error out silently and do nothing, while frustratingly work for the simpler commands version/info commands. My silent errors were due to a bad plugin. This plugin was using php short tags, which weren’t enabled in php/x.x/cli/php.ini which wp-cli uses.
TL;DR: Run wp version –debug Check that wp-cli.yml was found Check that the ABSPATH set by WP-CLI matches the directory where WP is installed Look at find_wp_root() for hints about why it’s finding the wrong folder The docs say: inside the current working directory (or upwards) …so you should be able to use it in … Read more