language_attributes
Filter HookDescription
Filters the language attributes for display in the 'html' tag.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4531 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$output
|
A space-separated list of language attributes. |
string
|
$doctype
|
The type of HTML document (xhtml|html). |
Usage Examples
Basic Usage
<?php
// Hook into language_attributes
add_filter('language_attributes', 'my_custom_filter', 10, 2);
function my_custom_filter($output, $doctype) {
// Your custom filtering logic here
return $output;
}
Source Code Context
wp-includes/general-template.php:4531
- How this hook is used in WordPress core
<?php
4526 * @since 4.3.0 Added the `$doctype` parameter.
4527 *
4528 * @param string $output A space-separated list of language attributes.
4529 * @param string $doctype The type of HTML document (xhtml|html).
4530 */
4531 return apply_filters( 'language_attributes', $output, $doctype );
4532 }
4533
4534 /**
4535 * Displays the language attributes for the 'html' tag.
4536 *
PHP Documentation
<?php
/**
* Filters the language attributes for display in the 'html' tag.
*
* @since 2.5.0
* @since 4.3.0 Added the `$doctype` parameter.
*
* @param string $output A space-separated list of language attributes.
* @param string $doctype The type of HTML document (xhtml|html).
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.