WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15566 closed enhancement (invalid)

if + else = always

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: has-patch close
Focuses: Cc:

Description

	if ( 'page' == $post->post_type )
		clean_page_cache( $post_id );
	else
		clean_post_cache( $post_id );

should be written as

	clean_page_cache( $post_id );

Attachments (1)

15566.patch (755 bytes) - added by hakre 3 years ago.

Download all attachments as: .zip

Change History (6)

hakre3 years ago

comment:1 hakre3 years ago

  • Keywords has-patch added
  • Version set to 3.1

comment:2 ocean903 years ago

  • Keywords close added

But you know that clean_page_cache() != clean_post_cache() ?

comment:3 hakre3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

thanks for the look.

comment:4 ocean903 years ago

  • Milestone Awaiting Review deleted

comment:5 Denis-de-Bernardy3 years ago

Indeed it isn't... That said... Shouldn't it be:

	if ( $is_hierarchical )
		clean_page_cache( $post_id );
	else
		clean_post_cache( $post_id );
Note: See TracTickets for help on using tickets.