- Timestamp:
- 04/28/2024 12:23:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-optouts-list-table.php
r13469 r13818 129 129 * @since 8.0.0 130 130 * 131 * @param string $url_base Current URL base for view. 132 * @param array $active_filters Current filters being requested. 131 * @param string $url_base Current URL base for view. 133 132 */ 134 do_action( 'bp_optouts_list_table_get_views', $url_base , $this->active_filters); ?>133 do_action( 'bp_optouts_list_table_get_views', $url_base ); ?> 135 134 </ul> 136 135 <?php … … 225 224 $style = ''; 226 225 foreach ( $this->items as $optout ) { 227 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 226 $style = 'alt' == $style ? '' : 'alt'; 227 228 // Escapes are made into `self::single_row()`. 229 // phpcs:ignore WordPress.Security.EscapeOutput 228 230 echo "\n\t" . $this->single_row( $optout, $style ); 229 231 } … … 244 246 */ 245 247 public function single_row( $optout = null, $style = '', $role = '', $numposts = 0 ) { 246 echo '<tr' . $style . ' id="optout-' . intval( $optout->id ) . '">'; 248 if ( '' === $style ) { 249 echo '<tr id="optout-' . intval( $optout->id ) . '">'; 250 } else { 251 echo '<tr class="alternate" id="optout-' . intval( $optout->id ) . '">'; 252 } 253 254 // BuddyPress relies on WordPress's `WP_Users_List_Table::single_row_columns()`. 255 // phpcs:ignore WordPress.Security.EscapeOutput 247 256 echo $this->single_row_columns( $optout ); 248 257 echo '</tr>'; … … 307 316 $actions = apply_filters( 'bp_optouts_management_row_actions', $actions, $optout ); 308 317 318 // BuddyPress relies on WordPress's `WP_Users_List_Table::row_actions()`. 319 // phpcs:ignore WordPress.Security.EscapeOutput 309 320 echo $this->row_actions( $actions ); 310 321 } … … 318 329 */ 319 330 public function column_username( $optout = null ) { 320 $avatar = get_avatar( $optout->user_id, 32 );331 $avatar = get_avatar( $optout->user_id, 32 ); 321 332 $inviter = get_user_by( 'id', $optout->user_id ); 333 322 334 if ( ! $inviter ) { 323 335 return; 324 336 } 337 325 338 $user_link = bp_members_get_user_url( $optout->user_id ); 326 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), esc_html( $inviter->user_login ) ); 339 340 echo wp_kses( 341 $avatar, 342 array( 343 'img' => array( 344 'alt' => true, 345 'src' => true, 346 'srcset' => true, 347 'class' => true, 348 'height' => true, 349 'width' => true, 350 ) 351 ) 352 ); 353 printf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), esc_html( $inviter->user_login ) ); 327 354 } 328 355 … … 336 363 public function column_user_registered( $optout = null ) { 337 364 $inviter = get_user_by( 'id', $optout->user_id ); 365 338 366 if ( ! $inviter ) { 339 367 return; 340 368 } 369 341 370 echo esc_html( mysql2date( 'Y/m/d g:i:s a', $inviter->user_registered ) ); 342 371 } … … 362 391 public function column_email_type_description( $optout = null ) { 363 392 $type_term = get_term_by( 'slug', $optout->email_type, 'bp-email-type' ); 393 364 394 if ( $type_term ) { 365 395 echo esc_html( $type_term->description );
Note:
See TracChangeset
for help on using the changeset viewer.