Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: list_pages

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
1097       * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
1098       */
1099      function start_el(&$output, $page, $depth, $args) {
1100           $pad = str_repeat(' ', $depth * 3);
1101
1102           $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";
1103           if ( $page->ID == $args['selected'] )
1104                $output .= ' selected="selected"';
1105           $output .= '>';
1106           $title = apply_filters( 'list_pages', $page->post_title );
1107           $output .= $pad . esc_html( $title );
1108           $output .= "</option>\n";
1109      }
1110 }
1111
1112 //
1113 // Attachments
1114 //
1115