prefix, $wpdb->get_charset_collate() ); foreach ( $statements as $sql ) { dbDelta( $sql ); } foreach ( array_keys( $statements ) as $key ) { $table = $wpdb->prefix . 'hostkhata_' . $key; $found = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching if ( $found !== $table ) { throw new RuntimeException( sprintf( 'Table %s could not be created.', $table ) ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped } } } }