Опубликовано 13 октября, 2015 - 20:02
/**
* Implements hook_feeds_parser_sources_alter();
*/
function ft_feeds_parser_sources_alter(&$sources, $content_type) {
$sources['feeds_original_url'] = array(
'name' => t('Feed source url'),
'description' => t('Feed start url.'),
'callback' => 'ft_get_feeds_original_url',
);
}
function ft_get_feeds_original_url(FeedsSource $source, FeedsParserResult $result, $key) {
$config = $source->getConfig();
$fetcher_class_name = get_class($source->importer()->fetcher);
$url = $config[$fetcher_class_name]['source'];
return $url;
}