/**
  * Clears the transient cache when a given option is updated, if that option has been registered before
  *
  * @param string $option The option that's being updated.
  */
 public static function clear_transient_cache($option)
 {
     if (isset(self::$cache_clear[$option])) {
         if ('' !== self::$cache_clear[$option]) {
             YMBESEO_invalidate_sitemap_cache(self::$cache_clear[$option]);
         } else {
             self::clear_sitemap_cache();
         }
     }
 }
Beispiel #2
0
/**
 * Invalidate the XML sitemap cache for a post type when publishing or updating a post
 *
 * @param int $post_id
 */
function YMBESEO_invalidate_sitemap_cache_on_save_post($post_id)
{
    // If this is just a revision, don't invalidate the sitemap cache yet.
    if (wp_is_post_revision($post_id)) {
        return;
    }
    YMBESEO_invalidate_sitemap_cache(get_post_type($post_id));
}