Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
d0da3ea2
Commit
d0da3ea2
authored
Feb 17, 2017
by
Erick Hitter
Browse files
Standardized cache clearing
parent
2f019c6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/class-events-store.php
View file @
d0da3ea2
...
...
@@ -427,8 +427,7 @@ class Events_Store extends Singleton {
$wpdb
->
insert
(
$this
->
get_table_name
(),
$job_post
);
}
// Delete internal cache
wp_cache_delete
(
self
::
CACHE_KEY
);
$this
->
flush_internal_caches
();
}
/**
...
...
@@ -463,7 +462,7 @@ class Events_Store extends Singleton {
// Delete internal cache
// Should only be skipped when deleting duplicates, as they are excluded from the cache
if
(
$flush_cache
)
{
wp_cache_delete
(
self
::
CACHE_KEY
);
$this
->
flush_internal_caches
(
);
}
return
(
bool
)
$success
;
...
...
@@ -501,6 +500,13 @@ class Events_Store extends Singleton {
return
$differences
;
}
/**
* Delete the cached representation of the cron option
*/
public
function
flush_internal_caches
()
{
return
wp_cache_delete
(
self
::
CACHE_KEY
);
}
/**
* Prevent event store from creating new entries
*
...
...
includes/functions.php
View file @
d0da3ea2
...
...
@@ -135,10 +135,10 @@ function count_events_by_status( $status ) {
/**
* Flush plugin's internal caches
*
* FOR INTERNAL USE ONLY - see WP-CLI; all other cache clearance should happen through the `Events_Store` class
* FOR INTERNAL USE ONLY - see WP-CLI; all other cache clearance should happen
automatically
through the `Events_Store` class
*/
function
_flush_internal_caches
()
{
return
wp_cache_delete
(
Events_Store
::
CACHE_KEY
);
return
Events_Store
::
instance
()
->
flush_internal_caches
(
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment