Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_title

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
279       * @param object $item Nav menu item.
280       * @return string The original title.
281       */
282      protected function get_original_title( $item ) {
283           $original_title = '';
284           if ( 'post_type' === $item->type && ! empty( $item->object_id ) ) {
285                $original_object = get_post( $item->object_id );
286                if ( $original_object ) {
287                     /** This filter is documented in wp-includes/post-template.php */
288                     $original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID );
289
290                     if ( '' === $original_title ) {
291                          /* translators: %d: ID of a post */
292                          $original_title = sprintf( __( '#%d (no title)' ), $original_object->ID );
293                     }
294                }
295           } elseif ( 'taxonomy' === $item->type && ! empty( $item->object_id ) ) {
296                $original_term_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
297                if ( ! is_wp_error( $original_term_title ) ) {