Compare commits
No commits in common. 'deploy' and 'master' have entirely different histories.
@ -1,35 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<xbel version="1.0" xmlns:show="https://radiomanifest.degenerazione.xyz/shows/">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
function escape_to_xml($text) {
|
|
||||||
$escaped_text = wp_strip_all_tags($text);
|
|
||||||
$escaped_text = esc_xml($escaped_text);
|
|
||||||
return $escaped_text;
|
|
||||||
}
|
|
||||||
|
|
||||||
$post_options = array(
|
|
||||||
'post_type' => 'broadcast',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'orderby' => 'modified'
|
|
||||||
);
|
|
||||||
|
|
||||||
$broadcasts = get_posts($post_options);
|
|
||||||
|
|
||||||
foreach ($broadcasts as $post) { ?>
|
|
||||||
<bookmark href="<?php echo get_permalink($post->ID); ?>">
|
|
||||||
<title><?php echo $post->post_title; ?></title>
|
|
||||||
<info>
|
|
||||||
<metadata owner="https://radiomanifest.degenerazione.xyz/">
|
|
||||||
<show:name><?php echo $post->post_title; ?></show:name>
|
|
||||||
<show:id><?php echo $post->ID ?> </show:id>
|
|
||||||
<show:description><?php echo escape_to_xml(get_the_excerpt($post=$post)); ?></show:description>
|
|
||||||
<show:website><?php echo get_permalink($post->ID); ?></show:website>
|
|
||||||
<show:feed><?php echo (get_site_url() . '/feed/podcast/' . $post->post_name); ?></show:feed>
|
|
||||||
</metadata>
|
|
||||||
</info>
|
|
||||||
</bookmark>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</xbel>
|
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
function add_shows_feed() {
|
|
||||||
add_feed( 'shows.xml', 'render_shows_feed' );
|
|
||||||
}
|
|
||||||
add_action( 'init', 'add_shows_feed' );
|
|
||||||
|
|
||||||
function render_shows_feed() {
|
|
||||||
load_template(dirname(__FILE__)."/../feeds/radiomanifest-shows.php" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// enable cors policy for every feed
|
|
||||||
function add_header_origin() {
|
|
||||||
if (is_feed()){
|
|
||||||
header( 'Access-Control-Allow-Origin: *' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action( 'pre_get_posts', 'add_header_origin' );
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in New Issue