Changeset 6334 for trunk/src/includes/users/template.php
- Timestamp:
- 03/01/2017 02:17:21 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/users/template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/template.php
r6332 r6334 57 57 58 58 /** 59 * Set up the next user and iterate current user index.59 * PHP5 constructor. 60 60 * 61 61 * @since 2.6.0 bbPress (r6330) 62 62 * @access public 63 63 * 64 * @param null|string|array $query Optional. The query variables. 65 */ 66 public function __construct( $query = null ) { 67 if ( ! empty( $query ) ) { 68 parent::__construct( $query ); 69 $this->user_count = count( $this->results ); 70 } 71 } 72 73 /** 74 * Set up the next user and iterate current user index. 75 * 76 * @since 2.6.0 bbPress (r6330) 77 * @access public 78 * 64 79 * @return WP_User Next user. 65 80 */ 66 81 public function next_user() { 67 68 82 $this->current_user++; 69 70 $this->user = $this->users[ $this->current_user ]; 83 $this->user = $this->results[ $this->current_user ]; 71 84 72 85 return $this->user; … … 89 102 // loop has just started 90 103 if ( $this->current_user === -1 ) { 104 91 105 /** 92 106 * Fires once the loop is started. 93 107 * 94 * @since 2.6.0 bbPress 108 * @since 2.6.0 bbPress (r6330) 95 109 * 96 110 * @param WP_Query &$this The WP_Query instance (passed by reference). … … 99 113 } 100 114 101 $this-> user = $this->next_user();115 $this->next_user(); 102 116 } 103 117 … … 120 134 * Fires once the loop has ended. 121 135 * 122 * @since 2. 0.0136 * @since 2.6.0 bbPress (r6330) 123 137 * 124 138 * @param WP_Query &$this The WP_Query instance (passed by reference). … … 145 159 146 160 if ( $this->user_count > 0 ) { 147 $this->user = $this-> users[ 0 ];161 $this->user = $this->results[ 0 ]; 148 162 } 149 163 } … … 190 204 */ 191 205 function bbp_users() { 192 return bbpress()->user_query->have_users(); ;206 return bbpress()->user_query->have_users(); 193 207 } 194 208 … … 238 252 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) { 239 253 $bbp_user_id = $user_id; 254 255 // Currently inside a user loop 256 } elseif ( ! empty( $bbp->user_query->in_the_loop ) && isset( $bbp->user_query->user->ID ) ) { 257 $bbp_user_id = $bbp->user_query->user->ID; 240 258 241 259 // Currently viewing or editing a user
Note: See TracChangeset
for help on using the changeset viewer.