Code Duplication    Length = 9-9 lines in 2 locations

includes/class-give-cli-commands.php 1 location

@@ 797-805 (lines=9) @@
794
				$error       = false;
795
				$option_name = $option_name['option_name'];
796
797
				switch ( true ) {
798
					case ( false !== strpos( $option_name, 'transient' ) ):
799
						$option_name = str_replace( '_transient_', '', $option_name );
800
						$error       = delete_transient( $option_name );
801
						break;
802
803
					default:
804
						$error = delete_option( $option_name );
805
				}
806
807
				if ( $error ) {
808
					WP_CLI::log( $this->color_message( self::$counter, $option_name ) );

includes/admin/upgrades/upgrade-functions.php 1 location

@@ 1100-1108 (lines=9) @@
1097
1098
	if ( ! empty( $cached_options ) ) {
1099
		foreach ( $cached_options as $option ) {
1100
			switch ( true ) {
1101
				case ( false !== strpos( $option, 'transient' ) ):
1102
					$option = str_replace( '_transient_', '', $option );
1103
					delete_transient( $option );
1104
					break;
1105
1106
				default:
1107
					delete_option( $option );
1108
			}
1109
		}
1110
	}
1111
}