関数 fetch_feed()
関数 fetch_feed()
定義ファイル :/blog/wp-includes/feed.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | function fetch_feed( $url ) { require_once( ABSPATH . WPINC . '/class-feed.php' ); $feed = new SimplePie(); $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); // We must manually overwrite $feed->sanitize because SimplePie's // constructor sets it before we have a chance to set the sanitization class $feed->sanitize = new WP_SimplePie_Sanitize_KSES(); $feed->set_cache_class( 'WP_Feed_Cache' ); $feed->set_file_class( 'WP_SimplePie_File' ); $feed->set_feed_url( $url ); do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); $feed->init(); $feed->handle_content_type(); if ( $feed->error() ) return new WP_Error( 'simplepie-error', $feed->error() ); return $feed; } |