Changeset 6302 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
- Timestamp:
- 12/21/2017 05:45:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r6178 r6302 111 111 */ 112 112 function wporg_support_get_views() { 113 $all = bbp_get_views(); 114 $ordered = array( 113 $views = array( 115 114 'all-topics', 116 115 'no-replies', … … 118 117 'taggedmodlook', 119 118 ); 120 $found = array(); 121 foreach ( $ordered as $view ) { 122 if ( array_key_exists( $view, $all ) ) { 123 $found[] = $view; 119 120 $output = array(); 121 122 foreach ( $views as $view ) { 123 if ( ! bbp_get_view_id( $view ) ) { 124 continue; 124 125 } 125 } 126 $view_iterator = 0; 127 $view_count = count( $found ); 128 129 foreach ( $found as $view ) : $view_iterator++; ?> 130 131 <li class="view"><a href="<?php bbp_view_url( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li> 132 133 <?php if ( $view_iterator < $view_count ) : ?>|<?php endif; ?> 134 135 <?php endforeach; 136 137 // Unset variables 138 unset( $view_count, $view_iterator, $view, $found, $all, $ordered ); 126 127 $output[] = sprintf( '<li class="view"><a href="%s">%s</a></li>', 128 esc_url( bbp_get_view_url( $view ) ), 129 bbp_get_view_title( $view ) 130 ); 131 } 132 133 echo implode( ' | ', $output ); 139 134 } 140 135
Note: See TracChangeset
for help on using the changeset viewer.