Skip to content

Commit

Permalink
Add documentation for wpseo_sitemap_public_url filter
Browse files Browse the repository at this point in the history
  • Loading branch information
pls78 committed Sep 6, 2024
1 parent 4b31bf6 commit f77f1af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/features/xml-sitemaps/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,15 @@ add_filter( 'wpseo_sitemap_urlset', function( $urlset ) {
return str_replace( '>', ' xmlns:xhtml="http://www.w3.org/1999/xhtml">', $urlset );
}, 1, 10 );
```

### Filter the sitemap URL
```php
/**
* Allows filtering of the XSL URL used in the current environment.
*
* @param string $current_url The current XSL URL.
*/
add_filter( 'wpseo_sitemap_public_url', function ( $current_url ) {
return 'https://another-url.com/main-sitemap.xml';
} );
```

0 comments on commit f77f1af

Please sign in to comment.