Title: Patch to set default language
Last modified: August 20, 2016

---

# Patch to set default language

 *  [kchodorow](https://wordpress.org/support/users/kchodorow/)
 * (@kchodorow)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/patch-to-set-default-language/)
 * Sometimes I like to use <pre line=”1″> or <pre highlight=”7″>, but then Geshi
   spits out tons of PHP warnings because no “lang” attribute is defined.
 * This patch for wp-syntax.php fixes the warnings by setting the language to “text”
   if a “lang” isn’t given:
 *     ```
       @@ -110,6 +110,10 @@ function wp_syntax_highlight($match)
            $match = $wp_syntax_matches[$i];
   
            $language = strtolower(trim($match[1]));
       +    if (empty($language)) {
       +      $language = "text";
       +    }
       +
            $line = trim($match[2]);
            $escaped = trim($match[3]);
       ```
   

The topic ‘Patch to set default language’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-syntax_f8f6f6.svg)
 * [WP-Syntax](https://wordpress.org/plugins/wp-syntax/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-syntax/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-syntax/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-syntax/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-syntax/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-syntax/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [kchodorow](https://wordpress.org/support/users/kchodorow/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/patch-to-set-default-language/)
 * Status: not resolved