wp_title
Filter HookDescription
Filters the text of the page title.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1458 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$title
|
Page title. |
string
|
$sep
|
Title separator. |
string
|
$seplocation
|
Location of the separator (either 'left' or 'right'). |
Usage Examples
Basic Usage
<?php
// Hook into wp_title
add_filter('wp_title', 'my_custom_filter', 10, 3);
function my_custom_filter($title, $sep, $seplocation) {
// Your custom filtering logic here
return $title;
}
Source Code Context
wp-includes/general-template.php:1458
- How this hook is used in WordPress core
<?php
1453 *
1454 * @param string $title Page title.
1455 * @param string $sep Title separator.
1456 * @param string $seplocation Location of the separator (either 'left' or 'right').
1457 */
1458 $title = apply_filters( 'wp_title', $title, $sep, $seplocation );
1459
1460 // Send it out.
1461 if ( $display ) {
1462 echo $title;
1463 } else {
PHP Documentation
<?php
/**
* Filters the text of the page title.
*
* @since 2.0.0
*
* @param string $title Page title.
* @param string $sep Title separator.
* @param string $seplocation Location of the separator (either 'left' or 'right').
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.