Object cache conflict: Breaks Ad saving
-
Your Ad saving code uses the WordPress database directly, which skips invalidating the post in the object cache (if there is one activated).
Using any object cache plugin (eg.: Redis Object Cache: 1.2) causes the Ad editor to show the last cached post_content the Ad content editor.
You can easily avoid this, there is a quick fix:
classes/ads.php
Take the save code
public function save(){ global $wpdb; // remove slashes from content $content = $this->prepare_content_to_save(); $where = array('ID' => $this->id); $wpdb->update( $wpdb->posts, array( 'post_content' => $content ), $where );and add a clean_post_cache call direcly after $wpdb->update:
// clean post from object cache clean_post_cache( $this->id );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Object cache conflict: Breaks Ad saving’ is closed to new replies.