# friends/2.7.4/templates/admin/opml.php

Friends, version 2.7.4. 39 lines.

- Page: https://pluginprobe.com/plugins/friends/2.7.4/code/templates/admin/opml.php
- Raw: https://pluginprobe.com/plugins/friends/2.7.4/raw/templates/admin/opml.php
- Modified: 2022-11-13T14:21:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/friends/2.7.4/code/templates/admin/opml.php#L10-L20`.

```php
<?php
/**
 * This template generates the OPML to read your friend posts in a feed reader.
 *
 * @version 1.0
 * @package Friends
 */

header( 'Content-Disposition: attachment; filename=' . $args['filename'] );
header( 'Content-Type: text/opml+xml' );

echo '<' . '?xml version="1.0" encoding="utf-8"?' . '>';

?>
<opml version="2.0">
	<head>
		<title><?php echo esc_html( $args['title'] ); ?></title>
		<dateCreated><?php echo esc_html( gmdate( 'r' ) ); ?></dateCreated>
		<ownerName><?php echo esc_html( wp_get_current_user()->display_name ); ?></ownerName>
	</head>
	<body>
<?php
foreach ( $args['feeds'] as $role => $users ) {
	?>
	<outline text="<?php echo esc_attr( $role ); ?>">
	<?php
	foreach ( $users as $user ) {
		foreach ( $user['feeds'] as $feed ) {
			?>
		<outline text="<?php echo esc_attr( $user['friend_user']->display_name ); ?>" htmlUrl="<?php echo esc_url( $feed['html_url'] ); ?>" title="<?php echo esc_attr( $feed['title'] ); ?>" type="<?php echo esc_attr( $feed['type'] ); ?>" xmlUrl="<?php echo esc_url( $feed['xml_url'] ); ?>"/>
			<?php
		}
	}
	?>
	</outline>
<?php } ?>
	</body>
</opml>

```
