Skip to content
wiki.fftac.org

Functions - Source Excerpt 09

Back to Functions

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/themes/spiralist/functions.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/themes/spiralist/functions.php

if (preg_match('/\blang=(["\'])(.*?)\1/', $output)) {
        return preg_replace('/\blang=(["\'])(.*?)\1/', 'lang="' . esc_attr($html_lang) . '"', $output, 1) ?: $output;
    }

    return trim($output . ' lang="' . esc_attr($html_lang) . '"');
}
add_filter('language_attributes', 'spiralist_language_attributes', 10, 2);