예제 #1
0
         // Feeds related to a custom post type archive view.
         if (!$post_id) {
             break;
             // Break switch handler.
         }
         if (!($post = get_post($post_id))) {
             break;
             // Break switch handler.
         }
         $variations = array_merge($variations, $utils->postTypeArchiveFeedLinkVariations($post));
         break;
         // Break switch handler.
         // @TODO Possibly consider search-related feeds in the future.
         //    See: <http://codex.wordpress.org/WordPress_Feeds#Categories_and_Tags>
 }
 if (!($variation_regex_frags = $utils->convertVariationsToHostCachePathRegexFrags($variations))) {
     return $counter;
     // Nothing to do here.
 }
 $in_sets_of = $self->applyWpFilters(GLOBAL_NS . '_autoClearXmlFeedsCache_in_sets_of', 10, get_defined_vars());
 for ($_i = 0; $_i < count($variation_regex_frags); $_i = $_i + $in_sets_of) {
     $_variation_regex_frags = array_slice($variation_regex_frags, $_i, $in_sets_of);
     $_regex = '/^\\/(?:' . implode('|', $_variation_regex_frags) . ')\\./i';
     $counter += $self->clearFilesFromHostCacheDir($_regex);
 }
 unset($_i, $_variation_regex_frags, $_regex);
 // Housekeeping.
 if ($counter && is_admin() && (!IS_PRO || $self->options['change_notifications_enable'])) {
     $self->enqueueNotice('<img src="' . esc_attr($self->url('/src/client-s/images/clear.png')) . '" style="float:left; margin:0 10px 0 0; border:0;" />' . sprintf(__('<strong>%1$s:</strong> detected changes. Found %2$s in the cache, for XML feeds of type: <code>%3$s</code>; auto-clearing.', 'zencache'), esc_html(NAME), esc_html($self->i18nFiles($counter)), esc_html($type)));
 }
 return $counter;