Skip to content

Commit 1bf2d15

Browse files
committed
Some readability improvements
1 parent 2679e8c commit 1bf2d15

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

includes/class-wp-team-list.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function admin_render_profile_fields( WP_User $user ) {
122122
/**
123123
* Save team list profile fields.
124124
*
125-
* @param int $user_id ID of the user currently being edited.
125+
* @param int $user_id The current user's ID.
126126
*/
127127
public function admin_save_profile_fields( $user_id ) {
128128
if ( ! current_user_can( 'edit_user', $user_id ) ) {
@@ -143,18 +143,14 @@ public function admin_save_profile_fields( $user_id ) {
143143
*
144144
* @param string $val The current column value.
145145
* @param string $column_name Name of the current column.
146-
* @param int $user_id ID of the current user.
147-
* @return string
146+
* @param int $user_id The current user's ID.
147+
* @return string The column content. Either 'Visible' or 'Hidden'.
148148
*/
149149
public function admin_add_visibility_column_content( $val, $column_name, $user_id ) {
150150
$visibility = get_user_meta( $user_id, 'rplus_wp_team_list_visibility', true );
151151

152-
if ( 'rplus_wp_team_list_visibility' === $column_name ) {
153-
$val = __( 'Visible', 'wp-team-list' );
154-
155-
if ( 'hidden' === $visibility ) {
156-
$val = __( 'Hidden', 'wp-team-list' );
157-
}
152+
if ( 'wp_team_list_visibility' === $column_name ) {
153+
return ( 'hidden' === $visibility ) ? __( 'Hidden', 'wp-team-list' ) : __( 'Visible', 'wp-team-list' );
158154
}
159155

160156
return $val;
@@ -167,7 +163,7 @@ public function admin_add_visibility_column_content( $val, $column_name, $user_i
167163
* @return array The modified columns list.
168164
*/
169165
public function admin_add_visibility_column( $columns ) {
170-
$columns['rplus_wp_team_list_visibility'] = __( 'Team List', 'wp-team-list' );
166+
$columns['wp_team_list_visibility'] = __( 'Team List', 'wp-team-list' );
171167

172168
return $columns;
173169
}
@@ -276,7 +272,7 @@ protected function load_template( WP_User $user, $template = 'rplus-wp-team-list
276272
_deprecated_argument(
277273
__FUNCTION__,
278274
'2.0.0',
279-
printf( __( 'Use the %s filter instead.', 'wp-team-list' ), '<code>rplus_wp_team_list_template</code>' )
275+
printf( __( 'Use the %s filter instead.', 'wp-team-list' ), '<code>wp_team_list_template</code>' )
280276
);
281277
}
282278

@@ -506,6 +502,12 @@ public function filter_mce_css( $stylesheets ) {
506502
* @return false|string User avatar or false on failure.
507503
*/
508504
public function get_avatar( WP_User $user ) {
505+
/**
506+
* Filter the team list avatar size.
507+
*
508+
* @param int $size Avatar size. Default 50.
509+
* @param WP_User $user Current user object.
510+
*/
509511
$size = apply_filters( 'wp_team_list_avatar_size', 90, $user );
510512

511513
return get_avatar( $user->ID, $size );

0 commit comments

Comments
 (0)