WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 265 | * @param object $item Nav menu item. |
| 266 | * @return string The original title. |
| 267 | */ |
| 268 | protected function get_original_title( $item ) { |
| 269 | $original_title = ''; |
| 270 | if ( 'post_type' === $item->type && ! empty( $item->object_id ) ) { |
| 271 | $original_object = get_post( $item->object_id ); |
| 272 | if ( $original_object ) { |
| 273 | /** This filter is documented in wp-includes/post-template.php */ |
| 274 | $original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID ); |
| 275 | |
| 276 | if ( '' === $original_title ) { |
| 277 | /* translators: %d: ID of a post. */ |
| 278 | $original_title = sprintf( __( '#%d (no title)' ), $original_object->ID ); |
| 279 | } |
| 280 | } |
| 281 | } elseif ( 'taxonomy' === $item->type && ! empty( $item->object_id ) ) { |
| 282 | $original_term_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); |
| 283 | if ( ! is_wp_error( $original_term_title ) ) { |