PluginProbe
Friends / 2.9.1
Friends v2.9.1
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / feed-parsers / class-feed-parser-v2.php

class-feed-parser-v2.php in Friends 2.9.1, at feed-parsers/class-feed-parser-v2.php

46 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Friends Feed Parser
4 *
5 * This contains the reference implementation for a parser.
6 *
7 * @package Friends
8 */
9
10 namespace Friends;
11
12 /**
13 * This class describes a friends feed parser.
14 */
15 abstract class Feed_Parser_V2 extends Feed_Parser {
16
17 /**
18 * Fetches a feed and returns the processed items.
19 *
20 * Return an array of objects:
21 *
22 * return array(
23 * new Feed_Item array(
24 * 'permalink' => 'https://url.of/the/feed/item',
25 * 'title' => 'Title for the feed item',
26 * 'content' => 'Content for the feed item',
27 * 'date' => gmdate( 'Y-m-d H:i:s' ),
28 * // Optional fields:
29 * 'comment_count' => 0,
30 * 'gravatar' => 'https://url/icon.png',
31 * 'post_status' => 'publish', // A WordPress post status (e.g. publish or private).
32 * 'post_id' => 123, // the id of the post for better update/duplicate detection.
33 * 'updated_date' => gmdate( 'Y-m-d H:i:s' ),
34 * ),
35 * );
36 *
37 * @param string $url The url.
38 * @param User_Feed $user_feed The user feed.
39 *
40 * @return array An array of feed items.
41 */
42 public function fetch_feed( $url, User_Feed $user_feed = null ) {
43 return array();
44 }
45 }
46