Code Duplication    Length = 3-5 lines in 2 locations

modules/likes.php 1 location

@@ 1039-1043 (lines=5) @@
1036
1037
		if ( $post instanceof WP_Post ) {
1038
			// Check that the post is a public, published post.
1039
			if ( 'attachment' == $post->post_type ) {
1040
				$post_status = get_post_status( $post->post_parent );
1041
			} else {
1042
				$post_status = $post->post_status;
1043
			}
1044
			if ( 'publish' != $post_status ) {
1045
				$enabled = false;
1046
			}

modules/widgets/top-posts.php 1 location

@@ 566-568 (lines=3) @@
563
			 * To be able to remove attachment pages from private and password protect posts,
564
			 * we need to replace their post status by the parent post' status.
565
			 */
566
			if ( 'inherit' == $post->post_status && 'attachment' == $post->post_type ) {
567
				$post->post_status = get_post_status( $post_id );
568
			}
569
570
			// hide private and password protected posts
571
			if ( 'publish' != $post->post_status || ! empty( $post->post_password ) ) {