File tree Expand file tree Collapse file tree 2 files changed +177
-297
lines changed Expand file tree Collapse file tree 2 files changed +177
-297
lines changed Original file line number Diff line number Diff line change 6868}, $ pages );
6969
7070// Gather all our endpoints
71- $ allEndpoints = $ additionalEndpoints
72- + $ pageEndpoints
73- + $ chapterEndpoints
74- + $ bookEndpoints
75- + $ shelfEndpoints ;
71+ $ allEndpoints = array_merge (
72+ $ additionalEndpoints ,
73+ $ pageEndpoints ,
74+ $ chapterEndpoints ,
75+ $ bookEndpoints ,
76+ $ shelfEndpoints
77+ );
7678
7779// Fetch our sitemap XML
7880$ xmlSitemap = generateSitemapXml ($ allEndpoints );
@@ -87,6 +89,7 @@ function generateSitemapXml(array $endpoints): string
8789{
8890 global $ baseUrl ;
8991 $ doc = new DOMDocument ("1.0 " , "UTF-8 " );
92+ $ doc ->formatOutput = true ;
9093 $ urlset = $ doc ->createElement ('urlset ' );
9194 $ urlset ->setAttribute ('xmlns ' , 'http://www.sitemaps.org/schemas/sitemap/0.9 ' );
9295
You can’t perform that action at this time.
0 commit comments