Changeset 10355 for trunk/src/bp-core/classes/class-bp-walker-nav-menu.php
- Timestamp:
- 11/15/2015 07:13:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-walker-nav-menu.php
r10108 r10355 52 52 * @param array $elements See {@link Walker::walk()}. 53 53 * @param int $max_depth See {@link Walker::walk()}. 54 *55 54 * @return string See {@link Walker::walk()}. 56 55 */ … … 61 60 $output = ''; 62 61 63 if ( $max_depth < -1 ) // invalid parameter62 if ( $max_depth < -1 ) // Invalid parameter. 64 63 return $output; 65 64 66 if ( empty( $elements ) ) // nothing to walk65 if ( empty( $elements ) ) // Nothing to walk. 67 66 return $output; 68 67 69 68 $parent_field = $this->db_fields['parent']; 70 69 71 // flat display70 // Flat display. 72 71 if ( -1 == $max_depth ) { 73 72 … … 119 118 120 119 /* 121 * if we are displaying all levels, and remaining children_elements is not empty,122 * then we got orphans, which should be displayed regardless 120 * If we are displaying all levels, and remaining children_elements is not empty, 121 * then we got orphans, which should be displayed regardless. 123 122 */ 124 123 if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) { … … 149 148 */ 150 149 public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 151 // If we're someway down the tree, indent the HTML with the appropriate number of tabs 150 // If we're someway down the tree, indent the HTML with the appropriate number of tabs. 152 151 $indent = $depth ? str_repeat( "\t", $depth ) : ''; 153 152 … … 165 164 166 165 // Add HTML ID 167 $id = sanitize_html_class( $item->css_id . '-personal-li' ); // Backpat with BP pre-1.7 166 $id = sanitize_html_class( $item->css_id . '-personal-li' ); // Backpat with BP pre-1.7. 168 167 169 168 /** … … 182 181 $output .= $indent . '<li' . $id . $class_names . '>'; 183 182 184 // Add href attribute 183 // Add href attribute. 185 184 $attributes = ! empty( $item->link ) ? ' href="' . esc_url( $item->link ) . '"' : ''; 186 185 187 // Construct the link 186 // Construct the link. 188 187 $item_output = $args->before; 189 188 $item_output .= '<a' . $attributes . '>';
Note: See TracChangeset
for help on using the changeset viewer.