Skip to content

Commit

Permalink
Mention that custom database tables won't be emptied
Browse files Browse the repository at this point in the history
Doing so requires a bit of custom code.
  • Loading branch information
danielbachhuber committed Apr 12, 2016
1 parent 9e8a08a commit 6e9cd29
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions php/commands/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ private function _insert_default_terms() {
/**
* Empty a site of its content (posts, comments, and terms).
*
* This command doesn't empty custom database tables by default. To do so,
* you'll need to hook into command execution:
*
* ```
* WP_CLI::add_hook( 'after_invoke:site empty', function(){
* global $wpdb;
* foreach( array( 'p2p', 'p2pmeta' ) as $table ) {
* $table = $wpdb->$table;
* $wpdb->query( "TRUNCATE $table" );
* }
* });
* ```
*
* ## OPTIONS
*
* [--uploads]
Expand Down

0 comments on commit 6e9cd29

Please sign in to comment.