Changeset 7354 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php
- Timestamp:
- 07/02/2018 12:47:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php
r7306 r7354 223 223 public function add_toc( $content ) { 224 224 225 if ( ! is_singular() ) { 226 return $content; 227 } 228 225 229 $toc = ''; 226 230 … … 236 240 if ( $items ) { 237 241 $contents_header = sprintf( 'h%s', $items[0][2] ); 238 $toc .= '<div class="table-of-contents">';239 $toc .= '<h2 class="toc-title">' . __( 'Topics', 'wporg-forums' ) . '</h2>';240 $toc .= '<ul class="items">';241 $last_item = false;242 $toc .= '<div class="table-of-contents">'; 243 $toc .= '<h2 class="toc-title">' . __( 'Topics', 'wporg-forums' ) . '</h2>'; 244 $toc .= '<ul class="items">'; 245 $last_item = false; 242 246 foreach ( $items as $item ) { 243 247 if ( $last_item ) { … … 251 255 } 252 256 $last_item = $item[2]; 253 $toc .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] );257 $toc .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] ); 254 258 } 255 259 $toc .= '</ul></div>';
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)