Skip to content

Commit

Permalink
Added exception for simple_sitemap.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Aug 1, 2023
1 parent aa11706 commit 1fad3fd
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ public function filterWrite($name, array $data) {
}
}

// Exclude processing for some properties of the views.
if (fnmatch('views.view.civictheme_*', $name) && !str_contains($name, 'example') && !str_contains($name, 'test')) {
if (!empty($data['display'])) {
foreach (array_keys($data['display']) as $display_name) {
if (!empty($data['display'][$display_name]['display_options']['display_extenders'])) {
foreach (array_keys($data['display'][$display_name]['display_options']['display_extenders']) as $extender_name) {
if (str_starts_with($extender_name, 'simple_sitemap')) {
unset($data['display'][$display_name]['display_options']['display_extenders'][$extender_name]);
}
}
if (empty($data['display'][$display_name]['display_options']['display_extenders'])) {
unset($data['display'][$display_name]['display_options']['display_extenders']);
}
}
}
}
}

return $data;
}

Expand Down

0 comments on commit 1fad3fd

Please sign in to comment.