Opened 10 years ago
Closed 9 years ago
#2813 closed enhancement (fixed)
Improvements to bbp_clean_post_cache()
Reported by: | thebrandonallen | Owned by: | thebrandonallen |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | API - Cache | Keywords: | has-patch has-unit-tests |
Cc: |
Description
In r5774 when moved the majority of our cache validation to WP's clean_post_cache
hook. This hook can pass both the post id an the post object. However, we don't currently accept a second parameter in bbp_clean_post_cache()
. Attached patch allows a second parameter to be passed, and updates our add_action
call to send both parameters.
This change also reduces our current full suite test time by about 0.2 seconds. This should make difference as we flesh out the test suite, and should also result in a speed bump, however minor, during normal operation.
Refreshed patch to remove keys no longer used in 2.6, clean up PHPDoc, and adds unit tests.
The unit tests may seem bare, but the cache keys tested were the only meaningful tests. The assumption being that if it can handle those keys well, it should be fine with the others. Plus, if we ever break
bbp_clean_post_cache
, we'll know quickly, because a large number of our tests will start failing 😞