Skip to content

Commit 29b7d07

Browse files
committed
Reset option value to default for privacy policy on site empty
1 parent 6132db5 commit 29b7d07

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Site_Command.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ private function _insert_default_terms() {
135135
$wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $cat_id, 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 0));
136136
}
137137

138+
/**
139+
* Reset option values to default.
140+
*/
141+
private function _reset_options() {
142+
// Reset Privacy Policy value to prevent error.
143+
update_option( 'wp_page_for_privacy_policy', 0 );
144+
}
145+
138146
/**
139147
* Empties a site of its content (posts, comments, terms, and meta).
140148
*
@@ -186,6 +194,7 @@ public function _empty( $args, $assoc_args ) {
186194
$this->_empty_comments();
187195
$this->_empty_taxonomies();
188196
$this->_insert_default_terms();
197+
$this->_reset_options();
189198

190199
if ( ! empty( $upload_message ) ) {
191200
$upload_dir = wp_upload_dir();

0 commit comments

Comments
 (0)