Title: WP-CLI Resets Theme Customization
Last modified: July 17, 2022

---

# WP-CLI Resets Theme Customization

 *  [snowme](https://wordpress.org/support/users/snowme/)
 * (@snowme)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/)
 * Hi,
 * When I run any wp-cli command I get a PHP error `Notice: Undefined variable: 
   in /wp-content/themes/raindrops/functions.php on line 7657` and all the theme
   customization settings get reset to default. Can you help with this issue?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [estherramos](https://wordpress.org/support/users/estherramos/)
 * (@estherramos)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15832148)
 * Hello, Snowme.
    I do not know what you tell me and I do not know how to help.
   Is Nobita no longer carrying the support? Thank you very much.
 *  [estherramos](https://wordpress.org/support/users/estherramos/)
 * (@estherramos)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15832157)
 * Hello.
    Sorry, I made a mistake in answering here. Thanks.
 *  Theme Author [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15836915)
 * Hi [@snowme](https://wordpress.org/support/users/snowme/)
 * Unfortunately, the raindrops theme doesn’t consider wp-cli.
 * One salvation is that this theme is defined as a pluggable function for most 
   functions.
    In other words, if a function with the same name exists in functions.
   php of the child theme, that function will be used.
 * [https://github.com/tenman/raindrops/blob/master/functions.php#L7644-L7661](https://github.com/tenman/raindrops/blob/master/functions.php#L7644-L7661)
 * You can also rewrite the function in which this error occurs as follows.
 *     ```
       function raindrops_doctype_elements( $xhtml, $html5, $echo = true ) {
   
       	$doc_type = raindrops_warehouse_clone( 'raindrops_doc_type_settings' );
   
       	if ( true == $echo ) {
   
       		if ( 'html5' == $doc_type ) {
       			echo $html5;
       		} else {
       			echo $xhtml;
       		}
       	} else {
   
       		if ( 'html5' == $doc_type ) {
       			return $html5;
       		} else {
       			return $xhtml;
       		}
       	}
       }
       ```
   
 * I can’t help you enough, but if you need it, give it a try.
 * Thank you.
 *  Thread Starter [snowme](https://wordpress.org/support/users/snowme/)
 * (@snowme)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15840580)
 * I appreciate you offering support. Adding the function fixed the PHP error, but
   using WP CLI still resets the theme customization settings. I understand this
   is not supported so I’ll continue to look into the issue.
 *  Theme Author [nobita](https://wordpress.org/support/users/nobita/)
 * (@nobita)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15840682)
 * The theme reset is done with the following function.
 * [https://github.com/tenman/raindrops/blob/master/functions.php#L406-L440](https://github.com/tenman/raindrops/blob/master/functions.php#L406-L440)
 *     ```
       raindrops_warehouse_clone( 'raindrops_reset_options' )
       ```
   
 * This is generally the same as:
 *     ```
       get_option( 'raindrops_theme_settings' )['raindrops_reset_options']
       ```
   
 * Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WP-CLI Resets Theme Customization’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/raindrops/1.700/screenshot.png)
 * raindrops
 * [Support Threads](https://wordpress.org/support/theme/raindrops/)
 * [Active Topics](https://wordpress.org/support/theme/raindrops/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/raindrops/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/raindrops/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 5 replies
 * 3 participants
 * Last reply from: [nobita](https://wordpress.org/support/users/nobita/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/wp-cli-resets-theme-customization/#post-15840682)
 * Status: not resolved