Last active
January 5, 2026 10:34
-
-
Save Auke1810/82d3c5b32d3ef81b62d38e29bce7b2f8 to your computer and use it in GitHub Desktop.
Change XML header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // With the below filter; wppfm_custom_xml_header you can change the xml header of a custom XML feed | |
| // make sure you close it with the wppfm_custom_xml_footer filter. | |
| function wppfm_add_rss_to_xml_header( $title ) { | |
| return '<?xml version="1.0" encoding="UTF-8" ?>/r | |
| <rss version="2.0"><products>/r'; | |
| } | |
| add_filter( 'wppfm_custom_xml_header', 'wppfm_add_rss_to_xml_header' ); | |
| function wppfm_add_rss_to_xml_footer( $title ) { | |
| return '</products></rss>'; | |
| } | |
| add_filter( 'wppfm_custom_xml_footer', 'wppfm_add_rss_to_xml_footer' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment