Custom XML feeds

With the Add-on Jobs XML feeds, you can override the included XML template and add your own from your theme

To Override a template, you need to copy the feed class file from the plugin folder matador-jobs-pro-jobs-xml-feeds/xml to a folder in the theme root matador/xml
Matador will then load this version, not the version included in the XML add-on

To add an extra feed, you still need to place the class file (I would copy one and rename it)
the file name needs to class-{nameOfFeed) and the class name needs to be {NameOfFeed}

And then, you need to use the filter ‘matador_xml_feeds’ to add the feed as in this example

    add_filter('matador_xml_feeds', function ($feeds) {
        $feeds[] = 'indeed2';
        return $feeds;
    });

This will look for a file called “class-indeed2.php and a class named ‘Indeed2’ and render a feed at {jobBroad}/indeed2
The class must have a function called ‘render_xml’ that outputs the XML needed

Updated on July 20, 2022
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support