I am trying to find how I can debug/kint a variable/array from the Simple XML Sitemap?
I worked through the documentation here: https://www.drupal.org/docs/8/modules/simple-xml-sitemap/api-and-extending-the-module#s-api-hooks to find the hook I need.
My goal is to unset any links that have node/
to remove published, but un-aliased nodes of included content types.
The array key ('path')
looks to be the unaliased URL and the below code removes all links except the home page. I am unsure how I can kint($link)
in this function so I can see what other array keys are available to see what else I may use for comparison.
function HOOK_simple_sitemap_links_alter(array &$links, $sitemap_variant) {
foreach ($links as $key => $link) {
if (strpos($link('meta')('path'), 'node/') !== FALSE) {
unset($links($key));
}
}
}
Is there a way to kint()
these sitemap arrays? Or maybe some documentation that shows the structure of these arrays?