Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Add extra attributes to sitemap entries #88

@joemcgill

Description

@joemcgill

Description

Which feature is your enhancement request related to?
This is related to #25.

Describe the solution you'd like
As a person or plugin extending the sitemaps functionality, I want to be able to add extra attributes to sitemap entries to provide additional data to web crawlers.

A few possible solutions:

  1. hook into the existing core_sitemaps_{object_type}_url_list filters to add attributes to the array which then get turned into XML nodes when the sitemap is rendered.

  2. Add a new filter inside of each provider's get_url_list() method that allows each URL to be modified as it's added to the $url_list array.

  3. Add a filter to Core_Sitemaps_Renderer::render_sitemap() that allows the XML output to be modified before the XML is echoed. The downside here being that filtering an SimpleXMLElement object is less intuitive that editing the raw data before the XML is created.

Acceptance Criteria

  • Additional attributes can be added to sitemap URL entries.
  • PHPUnit tests are added that confirm this functionality is working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementEnhancement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions