Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: codepress_supported_langs

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
308 /**
309  * Determines the language to use for CodePress syntax highlighting,
310  * based only on a filename.
311  *
312  * @since 2.8
313  *
314  * @param string $filename The name of the file to be highlighting
315 **/
316 function codepress_get_lang( $filename ) {
317      $codepress_supported_langs = apply_filters( 'codepress_supported_langs',
318                                              array( '.css' => 'css',
319                                                        '.js' => 'javascript',
320                                                        '.php' => 'php',
321                                                        '.html' => 'html',
322                                                        '.htm' => 'html',
323                                                        '.txt' => 'text'
324                                                        ) );
325      $extension = substr( $filename, strrpos( $filename, '.' ) );
326      if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) )