PluginProbe
Stream – Activity Log & Audit Trail / 3.9.0
Stream – Activity Log & Audit Trail v3.9.0
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
stream / includes / feeds / atom.php

atom.php in Stream – Activity Log & Audit Trail 3.9.0, at includes/feeds/atom.php

61 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Renders an Atom feed of records.
4 *
5 * @package WP_Stream
6 */
7
8 header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
9 printf( '<?xml version="1.0" encoding="%s"?>', esc_attr( get_option( 'blog_charset' ) ) );
10 ?>
11
12 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="<?php echo esc_attr( bloginfo_rss( 'language' ) ); ?>" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" <?php do_action( 'atom_ns' ); ?>>
13 <title><?php bloginfo_rss( 'name' ); ?> - <?php esc_html_e( 'Stream Feed', 'stream' ); ?></title>
14 <link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
15 <link href="<?php echo esc_url( $records_admin_url ); ?>" />
16 <subtitle type="html"><?php esc_html( bloginfo_rss( 'description' ) ); ?></subtitle>
17 <updated><?php echo esc_html( mysql2date( 'c', $latest_record, false ) ); ?></updated>
18 <id><?php echo esc_url( $latest_link ); ?></id>
19 <sy:updatePeriod><?php echo esc_html( 'hourly' ); ?></sy:updatePeriod>
20 <sy:updateFrequency><?php echo absint( 1 ); ?></sy:updateFrequency>
21 <?php
22 /**
23 * Action fires during RSS head
24 */
25 do_action( 'atom_head' );
26
27 foreach ( $records as $record ) :
28 $record_link = add_query_arg(
29 array(
30 'record__in' => $record->ID,
31 ),
32 $records_admin_url
33 );
34
35 $author = get_userdata( $record->author );
36 $display_name = isset( $author->display_name ) ? $author->display_name : 'N/A';
37 ?>
38 <entry>
39 <title type="html"><![CDATA[[<?php echo esc_html( $domain ); ?>] <?php echo esc_html( $record->summary ); // xss ok. ?> ]]></title>
40 <link href="<?php echo esc_url( $record_link ); ?>" />
41 <updated><?php echo esc_html( mysql2date( 'c', $record->created, false ) ); ?></updated>
42 <author>
43 <name><?php echo esc_html( $display_name ); ?></name>
44 </author>
45 <category term="connector" label="<?php echo esc_html( $record->connector ); ?>" />
46 <category term="context" label="<?php echo esc_html( $record->context ); ?>"/>
47 <category term="action" label="<?php echo esc_html( $record->action ); ?>" />
48 <category term="ip" label="<?php echo esc_html( $record->ip ); ?>" />
49 <id><?php echo esc_url( $record_link ); ?></id>
50 <summary type="html"><![CDATA[- <?php echo esc_html( $display_name ); ?> ]]></summary>
51 <?php
52 /**
53 * Action fires during Atom item
54 */
55 do_action( 'atom_item' )
56 ?>
57 </entry>
58 <?php endforeach; ?>
59 </feed>
60 <?php
61