Skip to content

Commit a266d4e

Browse files
committed
Refactor conditionals
1 parent 9de4c90 commit a266d4e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/wp-includes/author-template.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,21 @@ function get_the_modified_author( $post = null ) {
9696
if ( ! $post ) {
9797
return null;
9898
}
99-
$last_id = get_post_meta( $post->ID, '_edit_last', true );
10099

100+
$last_user = null;
101+
$last_id = get_post_meta( $post->ID, '_edit_last', true );
101102
if ( $last_id ) {
102103
$last_user = get_userdata( $last_id );
103-
104-
/**
105-
* Filters the display name of the author who last edited the current post.
106-
*
107-
* @since 2.8.0
108-
*
109-
* @param string $display_name The author's display name, empty string if unknown.
110-
*/
111-
return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
112104
}
113105

114-
return null;
106+
/**
107+
* Filters the display name of the author who last edited the current post.
108+
*
109+
* @since 2.8.0
110+
*
111+
* @param string $display_name The author's display name, empty string if unknown.
112+
*/
113+
return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
115114
}
116115

117116
/**

0 commit comments

Comments
 (0)