WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#35610 closed enhancement (fixed)

clean_comment_cache needs a hook

Reported by: spacedmonkey Owned by: ericlewis
Milestone: 4.5 Priority: normal
Severity: normal Version: 2.3
Component: Cache API Keywords:
Focuses: Cc:

Description

Unlike other cache clear functions, clean_comment_cache doesn't have a hook.

Attachments (3)

35610.patch (845 bytes) - added by spacedmonkey 4 years ago.
35610.1.patch (837 bytes) - added by spacedmonkey 4 years ago.
35610.2.patch (832 bytes) - added by spacedmonkey 4 years ago.
Third time's the charm

Download all attachments as: .zip

Change History (11)

@spacedmonkey
4 years ago

#1 follow-up: @ericlewis
4 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version set to 2.3

Makes sense to me.

Do we want unit tests for this?

#2 @rachelbaker
4 years ago

@spacedmonkey Looks like there is some copypasta in the hook docs

Fires once after each taxonomy's term cache has been cleaned.

@spacedmonkey
4 years ago

Third time's the charm

#3 @spacedmonkey
4 years ago

I don't think this requires unit tests no. Nice spot, @rachelbaker

#4 @ericlewis
4 years ago

  • Milestone changed from Future Release to 4.5

#5 in reply to: ↑ 1 @boonebgorges
4 years ago

  • Owner set to ericlewis
  • Status changed from new to assigned

Replying to ericlewis:

Makes sense to me.

Do we want unit tests for this?

Don't need unit tests for an action in most cases.

35610.2.patch should have extraneous spaces in new @param documentation removed, and I don't think we need a function-level @since addition for this (the info is in the hook docblock).

#6 @ericlewis
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36405:

Comments: Fire an action after a comment is removed from object cache.

When a comment is removed from the object cache, the clean_comment_cache action is now fired. This provides plugin and theme developers a chance to perform secondary cache invalidation as needed.

Props spacedmonkey.
Fixes #35610.

#7 @ericlewis
4 years ago

  • Keywords has-patch removed

#8 @DrewAPicture
4 years ago

In 36922:

Docs: Improve the DocBlock summary for the clean_comment_cache action, introduced in [36405].

See #35610. See #35986.

Note: See TracTickets for help on using tickets.