/**
  * Check for relevant post type before invalidation.
  *
  * @param int $post_id Post ID to possibly invalidate for.
  */
 public function save_post($post_id)
 {
     if ($this->is_valid_post_type(get_post_type($post_id))) {
         WPSEO_Sitemaps_Cache::invalidate_post($post_id);
     }
 }
Ejemplo n.º 2
0
/**
 * Invalidate the XML sitemap cache for a post type when publishing or updating a post
 *
 * @deprecated
 * @see WPSEO_Sitemaps_Cache
 *
 * @param int $post_id Post ID to determine post type for invalidation.
 */
function wpseo_invalidate_sitemap_cache_on_save_post($post_id)
{
    WPSEO_Sitemaps_Cache::invalidate_post($post_id);
}