'https://url.of/the/feed', * 'title' => 'Title from the tag if any', * 'mime-type' => 'mime-type from the tag if any', * // You can add these fields in the response: * 'autoselect' => true|false, * 'post-format' => 'standard', // or 'aside', etc. see get_post_format_strings() of WordPress core * ); * * @param array $feed_details The feed details. * * @return array The (potentially) modified feed details. */ public function update_feed_details( $feed_details ) { return $feed_details; } /** * Discover the feeds available at the URL specified. * * The content for the URL has already been fetched for you which can be analyzed. * * Return an array of supported feeds in the format of the $feed_details above: * * return array( * array( * 'url' => 'https://url.of/the/feed', * 'title' => 'Title for the feed', * 'mime-type' => 'mime-type for the feed', * 'rel' => 'e.g. alternate', * ), * ); * * @param string $content The content for the URL is already provided here. * @param string $url The url to search. * * @return array A list of supported feeds at the URL. */ public function discover_available_feeds( $content, $url ) { return array(); } /** * Convert relative URLs to absolute ones in incoming content. * * @param string $html The html. * @param string $url The url of the feed. * * @return string The HTML with URLs replaced to their absolute represenation. */ public function convert_relative_urls_to_absolute_urls( $html, $url ) { // For now this only converts links and image srcs. return preg_replace_callback( '~(src|href)=(?:"([^"]+)|\'([^\']+))~i', function ( $m ) use ( $url ) { return str_replace( $m[2], Mf2\resolveUrl( $url, $m[2] ), $m[0] ); }, $html ); } }