| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template generates the OPML to read your friend posts in a feed reader. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
header( 'Content-Disposition: attachment; filename=' . $args['filename'] ); |
| 10 |
header( 'Content-Type: text/opml+xml' ); |
| 11 |
|
| 12 |
echo '<' . '?xml version="1.0" encoding="utf-8"?' . '>'; |
| 13 |
|
| 14 |
?> |
| 15 |
<opml version="2.0"> |
| 16 |
<head> |
| 17 |
<title><?php echo esc_html( $args['title'] ); ?></title> |
| 18 |
<dateCreated><?php echo esc_html( gmdate( 'r' ) ); ?></dateCreated> |
| 19 |
<ownerName><?php echo esc_html( wp_get_current_user()->display_name ); ?></ownerName> |
| 20 |
</head> |
| 21 |
<body> |
| 22 |
<?php |
| 23 |
foreach ( $args['feeds'] as $_role => $users ) { |
| 24 |
?> |
| 25 |
<outline text="<?php echo esc_attr( $_role ); ?>"> |
| 26 |
<?php foreach ( $users as $user ) : /* phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect */ ?> |
| 27 |
<?php foreach ( $user['feeds'] as $feed ) : /* phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect */ ?> |
| 28 |
<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'] ); ?>"/> |
| 29 |
<?php endforeach; ?> |
| 30 |
<?php endforeach; ?> |
| 31 |
</outline> |
| 32 |
<?php } ?> |
| 33 |
</body> |
| 34 |
</opml> |
| 35 |
|