-
Notifications
You must be signed in to change notification settings - Fork 0
/
mediatags_feed.php
32 lines (28 loc) · 960 Bytes
/
mediatags_feed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/* Functions here handle all needed feed/rss functionality */
function add_mediatags_alternate_link()
{
global $wp_version;
$mediatag_rss_feed = get_option('mediatag_rss_feed', 'yes');
if ((!$mediatag_rss_feed) || ($mediatag_rss_feed != "yes"))
return;
$mediatag_var = get_query_var(MEDIA_TAGS_QUERYVAR);
if ($mediatag_var)
{
$mediatag_term = term_exists( $mediatag_var, MEDIA_TAGS_TAXONOMY );
if ($mediatag_term)
{
$mediatag_term = get_term($mediatag_term['term_id'], MEDIA_TAGS_TAXONOMY);
$feed_title = get_bloginfo('name') . " » ". __('Media-Tags RSS Feed', MEDIA_TAGS_I18N_DOMAIN)
." » " . $mediatag_term->name;
$feed_link = get_mediatag_link( $mediatag_term->term_id, true );
if ($feed_link)
{
?><link id="MediaTagsRSS" rel="alternate" type="application/rss+xml"
title="<?php echo esc_attr( $feed_title ); ?>"
href="<?php echo esc_attr( $feed_link ); ?>" />
<?php
}
}
}
}