diff --git a/inc/User.php b/inc/User.php index ee276f2a..a7fa5ce3 100644 --- a/inc/User.php +++ b/inc/User.php @@ -149,6 +149,9 @@ function dwqa_is_followed( $post_id = false, $user_id = false ) { function dwqa_the_author( $display_name ) { global $post; + if ( empty( $post ) ) { + return $display_name; + } if ( 'dwqa-answer' == $post->post_type || 'dwqa-question' == $post->post_type) { if ( dwqa_is_anonymous( $post->ID ) ) { $anonymous_name = get_post_meta( $post->ID, '_dwqa_anonymous_name', true ); @@ -283,4 +286,4 @@ function follow_question() { } } -?> \ No newline at end of file +?>