the_title
Filter HookDescription
Get original title.Hook Information
File Location |
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
View on GitHub
|
Hook Type | Filter |
Line Number | 273 |
Hook Parameters
Type | Name | Description |
---|---|---|
object
|
$item
|
Nav menu item. |
Usage Examples
Basic Usage
<?php
// Hook into the_title
add_filter('the_title', 'my_custom_filter', 10, 1);
function my_custom_filter($item) {
// Your custom filtering logic here
return $item;
}
Source Code Context
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:273
- How this hook is used in WordPress core
<?php
268 $original_title = '';
269 if ( 'post_type' === $item->type && ! empty( $item->object_id ) ) {
270 $original_object = get_post( $item->object_id );
271 if ( $original_object ) {
272 /** This filter is documented in wp-includes/post-template.php */
273 $original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID );
274
275 if ( '' === $original_title ) {
276 /* translators: %d: ID of a post. */
277 $original_title = sprintf( __( '#%d (no title)' ), $original_object->ID );
278 }
PHP Documentation
<?php
/**
* Get original title.
*
* @since 4.7.0
*
* @param object $item Nav menu item.
* @return string The original title.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
Related Hooks
Related hooks will be displayed here in future updates.