Code Duplication    Length = 3-5 lines in 2 locations

modules/widgets/top-posts.php 1 location

@@ 543-545 (lines=3) @@
540
			 * To be able to remove attachment pages from private and password protect posts,
541
			 * we need to replace their post status by the parent post' status.
542
			 */
543
			if ( 'inherit' == $post->post_status && 'attachment' == $post->post_type ) {
544
				$post->post_status = get_post_status( $post_id );
545
			}
546
547
			// hide private and password protected posts
548
			if ( 'publish' != $post->post_status || ! empty( $post->post_password ) ) {

modules/likes.php 1 location

@@ 1046-1050 (lines=5) @@
1043
1044
		if ( $post instanceof WP_Post ) {
1045
			// Check that the post is a public, published post.
1046
			if ( 'attachment' == $post->post_type ) {
1047
				$post_status = get_post_status( $post->post_parent );
1048
			} else {
1049
				$post_status = $post->post_status;
1050
			}
1051
			if ( 'publish' != $post_status ) {
1052
				$enabled = false;
1053
			}