Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

@@ 894-902 (lines=9) @@
891
892
	if ( ! empty( $cached_options ) ) {
893
		foreach ( $cached_options as $option ) {
894
			switch ( true ) {
895
				case ( false !== strpos( $option, 'transient' ) ):
896
					$option = str_replace( '_transient_', '', $option );
897
					delete_transient( $option );
898
					break;
899
900
				default:
901
					delete_option( $option );
902
			}
903
		}
904
	}
905
}