Changeset 3883 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/functions.php
- Timestamp:
- 08/30/2016 06:27:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/functions.php
r3798 r3883 89 89 /** 90 90 * Register these bbPress views: 91 * View: All Topics 92 * @ToDo View: Not Resolved 93 * @ToDo View: modlook 91 * View: All topics 92 * View: Tagged modlook 94 93 * 95 94 * @uses bbp_register_view() To register the view 96 95 */ 97 96 function wporg_support_custom_views() { 98 bbp_register_view( 'all-topics', __( 'All Topics', 'wporg-forums' ), array( 'order' => 'DESC' ), false ); 99 // bbp_register_view( 'support-forum-no', __( 'Not Resolved', 'wporg-forums' ), array( 'post_status' => 'closed' ), false ); 100 // bbp_register_view( 'taggedmodlook', __( 'Tagged modlook', 'wporg-forums' ), array( 'topic-tag' => 'modlook' ) ); 97 bbp_register_view( 'all-topics', __( 'All topics', 'wporg-forums' ), array( 'order' => 'DESC' ), false ); 98 if ( get_current_user_id() && current_user_can( 'moderate' ) ) { 99 bbp_register_view( 'taggedmodlook', __( 'Tagged modlook', 'wporg-forums' ), array( 'topic-tag' => 'modlook' ) ); 100 } 101 101 } 102 102 add_action( 'bbp_register_views', 'wporg_support_custom_views' ); 103 104 /** 105 * Display an ordered list of bbPress views 106 */ 107 function wporg_support_get_views() { 108 $all = bbp_get_views(); 109 $ordered = array( 110 'all-topics', 111 'no-replies', 112 'support-forum-no', 113 'taggedmodlook', 114 ); 115 $found = array(); 116 foreach ( $ordered as $view ) { 117 if ( array_key_exists( $view, $all ) ) { 118 $found[] = $view; 119 } 120 } 121 $view_iterator = 0; 122 $view_count = count( $found ); 123 124 foreach ( $found as $view ) : $view_iterator++; ?> 125 126 <li class="view"><a href="<?php bbp_view_url( $view ); ?>"><?php bbp_view_title( $view ); ?></a></li> 127 128 <?php if ( $view_iterator < $view_count ) : ?>|<?php endif; ?> 129 130 <?php endforeach; 131 132 // Unset variables 133 unset( $view_count, $view_iterator, $view, $found, $all, $ordered ); 134 } 103 135 104 136 /**
Note: See TracChangeset
for help on using the changeset viewer.