|
1 | 1 | <?php |
2 | | - /** |
3 | | - * Plugin Name: MF2 Feed |
4 | | - * Plugin URI: http://github.com/indieweb/wordpress-mf2-feed/ |
5 | | - * Description: Adds a Microformats2 JSON feed for every entry |
6 | | - * Version: 2.1.0 |
7 | | - * Author: Matthias Pfefferle |
8 | | - * Author URI: https://notiz.blog/ |
9 | | - * License: MIT |
10 | | - * License URI: http://opensource.org/licenses/MIT |
11 | | - * Text Domain: mf2-feed |
12 | | - * Domain Path: /languages |
13 | | - */ |
| 2 | +/** |
| 3 | + * Plugin Name: MF2 Feed |
| 4 | + * Plugin URI: http://github.com/indieweb/wordpress-mf2-feed/ |
| 5 | + * Description: Adds a Microformats2 JSON feed for every entry |
| 6 | + * Version: 2.1.0 |
| 7 | + * Author: Matthias Pfefferle |
| 8 | + * Author URI: https://notiz.blog/ |
| 9 | + * License: MIT |
| 10 | + * License URI: http://opensource.org/licenses/MIT |
| 11 | + * Text Domain: mf2-feed |
| 12 | + * Domain Path: /languages |
| 13 | + */ |
14 | 14 |
|
15 | 15 | add_action( 'init', array( 'Mf2Feed', 'init' ) ); |
16 | 16 |
|
@@ -62,20 +62,20 @@ public static function do_feed_mf2( $for_comments ) { |
62 | 62 |
|
63 | 63 | $post = $post->to_mf2(); |
64 | 64 |
|
65 | | - $items = array(); |
66 | | - $items['items'] = $post; |
| 65 | + $items = array(); |
| 66 | + $items['items'] = $post; |
67 | 67 | } else { |
68 | 68 | $items = array( |
69 | | - "items" => array( |
| 69 | + 'items' => array( |
70 | 70 | array( |
71 | | - 'type' => array( 'h-feed' ), |
| 71 | + 'type' => array( 'h-feed' ), |
72 | 72 | 'properties' => array( |
73 | | - 'name' => array( get_bloginfo( 'name' ) ), |
| 73 | + 'name' => array( get_bloginfo( 'name' ) ), |
74 | 74 | 'summary' => array( get_bloginfo( 'description' ) ), |
75 | | - 'url' => array( site_url( '/' ) ) |
76 | | - ) |
77 | | - ) |
78 | | - ) |
| 75 | + 'url' => array( site_url( '/' ) ), |
| 76 | + ), |
| 77 | + ), |
| 78 | + ), |
79 | 79 | ); |
80 | 80 |
|
81 | 81 | while ( have_posts() ) { |
@@ -119,7 +119,7 @@ public static function do_feed_jf2( $for_comments ) { |
119 | 119 | require_once dirname( __FILE__ ) . '/includes/class-mf2-feed-entry.php'; |
120 | 120 |
|
121 | 121 | if ( $for_comments ) { |
122 | | - $post = new Mf2_Feed_Entry( get_the_ID(), $for_comments ); |
| 122 | + $post = new Mf2_Feed_Entry( get_the_ID(), $for_comments ); |
123 | 123 | $items = $post->to_jf2(); |
124 | 124 | } else { |
125 | 125 | $items = array( 'type' => 'feed' ); |
@@ -193,15 +193,15 @@ public static function query_vars( $vars ) { |
193 | 193 | */ |
194 | 194 | public static function add_html_header() { |
195 | 195 | if ( is_singular() ) { |
196 | | - ?> |
| 196 | + ?> |
197 | 197 | <link rel="alternate" type="<?php echo esc_attr( feed_content_type( 'mf2' ) ); ?>" href="<?php echo esc_url( get_post_comments_feed_link( null, 'mf2' ) ); ?>" /> |
198 | 198 | <link rel="alternate" type="<?php echo esc_attr( feed_content_type( 'jf2' ) ); ?>" href="<?php echo esc_url( get_post_comments_feed_link( null, 'jf2' ) ); ?>" /> |
199 | | - <?php |
200 | | - } elseif ( is_home() ) { |
201 | | - ?> |
| 199 | + <?php |
| 200 | + } elseif ( is_home() ) { |
| 201 | + ?> |
202 | 202 | <link rel="alternate" type="<?php echo esc_attr( feed_content_type( 'mf2' ) ); ?>" href="<?php echo esc_url( get_feed_link( 'mf2' ) ); ?>" /> |
203 | 203 | <link rel="alternate" type="<?php echo esc_attr( feed_content_type( 'jf2' ) ); ?>" href="<?php echo esc_url( get_feed_link( 'jf2' ) ); ?>" /> |
204 | | - <?php |
| 204 | + <?php |
205 | 205 | } |
206 | 206 | } |
207 | 207 | } |
0 commit comments