equal
deleted
inserted
replaced
9 * @subpackage Feed |
9 * @subpackage Feed |
10 * @since 2.1.0 |
10 * @since 2.1.0 |
11 */ |
11 */ |
12 |
12 |
13 /** |
13 /** |
14 * RSS container for the bloginfo function. |
14 * Retrieves RSS container for the bloginfo function. |
15 * |
15 * |
16 * You can retrieve anything that you can using the get_bloginfo() function. |
16 * You can retrieve anything that you can using the get_bloginfo() function. |
17 * Everything will be stripped of tags and characters converted, when the values |
17 * Everything will be stripped of tags and characters converted, when the values |
18 * are retrieved for use in the feeds. |
18 * are retrieved for use in the feeds. |
19 * |
19 * |
39 */ |
39 */ |
40 return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show ); |
40 return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show ); |
41 } |
41 } |
42 |
42 |
43 /** |
43 /** |
44 * Display RSS container for the bloginfo function. |
44 * Displays RSS container for the bloginfo function. |
45 * |
45 * |
46 * You can retrieve anything that you can using the get_bloginfo() function. |
46 * You can retrieve anything that you can using the get_bloginfo() function. |
47 * Everything will be stripped of tags and characters converted, when the values |
47 * Everything will be stripped of tags and characters converted, when the values |
48 * are retrieved for use in the feeds. |
48 * are retrieved for use in the feeds. |
49 * |
49 * |
66 */ |
66 */ |
67 echo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show ); |
67 echo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show ); |
68 } |
68 } |
69 |
69 |
70 /** |
70 /** |
71 * Retrieve the default feed. |
71 * Retrieves the default feed. |
72 * |
72 * |
73 * The default feed is 'rss2', unless a plugin changes it through the |
73 * The default feed is 'rss2', unless a plugin changes it through the |
74 * {@see 'default_feed'} filter. |
74 * {@see 'default_feed'} filter. |
75 * |
75 * |
76 * @since 2.5.0 |
76 * @since 2.5.0 |
90 |
90 |
91 return ( 'rss' === $default_feed ) ? 'rss2' : $default_feed; |
91 return ( 'rss' === $default_feed ) ? 'rss2' : $default_feed; |
92 } |
92 } |
93 |
93 |
94 /** |
94 /** |
95 * Retrieve the blog title for the feed title. |
95 * Retrieves the blog title for the feed title. |
96 * |
96 * |
97 * @since 2.2.0 |
97 * @since 2.2.0 |
98 * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`. |
98 * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`. |
99 * |
99 * |
100 * @param string $deprecated Unused.. |
100 * @param string $deprecated Unused. |
101 * @return string The document title. |
101 * @return string The document title. |
102 */ |
102 */ |
103 function get_wp_title_rss( $deprecated = '–' ) { |
103 function get_wp_title_rss( $deprecated = '–' ) { |
104 if ( '–' !== $deprecated ) { |
104 if ( '–' !== $deprecated ) { |
105 /* translators: %s: 'document_title_separator' filter name. */ |
105 /* translators: %s: 'document_title_separator' filter name. */ |
117 */ |
117 */ |
118 return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated ); |
118 return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated ); |
119 } |
119 } |
120 |
120 |
121 /** |
121 /** |
122 * Display the blog title for display of the feed title. |
122 * Displays the blog title for display of the feed title. |
123 * |
123 * |
124 * @since 2.2.0 |
124 * @since 2.2.0 |
125 * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`. |
125 * @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`. |
126 * |
126 * |
127 * @param string $deprecated Unused. |
127 * @param string $deprecated Unused. |
145 */ |
145 */ |
146 echo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated ); |
146 echo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated ); |
147 } |
147 } |
148 |
148 |
149 /** |
149 /** |
150 * Retrieve the current post title for the feed. |
150 * Retrieves the current post title for the feed. |
151 * |
151 * |
152 * @since 2.0.0 |
152 * @since 2.0.0 |
153 * |
153 * @since 6.6.0 Added the `$post` parameter. |
|
154 * |
|
155 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. |
154 * @return string Current post title. |
156 * @return string Current post title. |
155 */ |
157 */ |
156 function get_the_title_rss() { |
158 function get_the_title_rss( $post = 0 ) { |
157 $title = get_the_title(); |
159 $title = get_the_title( $post ); |
158 |
160 |
159 /** |
161 /** |
160 * Filters the post title for use in a feed. |
162 * Filters the post title for use in a feed. |
161 * |
163 * |
162 * @since 1.2.0 |
164 * @since 1.2.0 |
165 */ |
167 */ |
166 return apply_filters( 'the_title_rss', $title ); |
168 return apply_filters( 'the_title_rss', $title ); |
167 } |
169 } |
168 |
170 |
169 /** |
171 /** |
170 * Display the post title in the feed. |
172 * Displays the post title in the feed. |
171 * |
173 * |
172 * @since 0.71 |
174 * @since 0.71 |
173 */ |
175 */ |
174 function the_title_rss() { |
176 function the_title_rss() { |
175 echo get_the_title_rss(); |
177 echo get_the_title_rss(); |
176 } |
178 } |
177 |
179 |
178 /** |
180 /** |
179 * Retrieve the post content for feeds. |
181 * Retrieves the post content for feeds. |
180 * |
182 * |
181 * @since 2.9.0 |
183 * @since 2.9.0 |
182 * |
184 * |
183 * @see get_the_content() |
185 * @see get_the_content() |
184 * |
186 * |
205 */ |
207 */ |
206 return apply_filters( 'the_content_feed', $content, $feed_type ); |
208 return apply_filters( 'the_content_feed', $content, $feed_type ); |
207 } |
209 } |
208 |
210 |
209 /** |
211 /** |
210 * Display the post content for feeds. |
212 * Displays the post content for feeds. |
211 * |
213 * |
212 * @since 2.9.0 |
214 * @since 2.9.0 |
213 * |
215 * |
214 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
216 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
215 */ |
217 */ |
216 function the_content_feed( $feed_type = null ) { |
218 function the_content_feed( $feed_type = null ) { |
217 echo get_the_content_feed( $feed_type ); |
219 echo get_the_content_feed( $feed_type ); |
218 } |
220 } |
219 |
221 |
220 /** |
222 /** |
221 * Display the post excerpt for the feed. |
223 * Displays the post excerpt for the feed. |
222 * |
224 * |
223 * @since 0.71 |
225 * @since 0.71 |
224 */ |
226 */ |
225 function the_excerpt_rss() { |
227 function the_excerpt_rss() { |
226 $output = get_the_excerpt(); |
228 $output = get_the_excerpt(); |
233 */ |
235 */ |
234 echo apply_filters( 'the_excerpt_rss', $output ); |
236 echo apply_filters( 'the_excerpt_rss', $output ); |
235 } |
237 } |
236 |
238 |
237 /** |
239 /** |
238 * Display the permalink to the post for use in feeds. |
240 * Displays the permalink to the post for use in feeds. |
239 * |
241 * |
240 * @since 2.3.0 |
242 * @since 2.3.0 |
241 */ |
243 */ |
242 function the_permalink_rss() { |
244 function the_permalink_rss() { |
243 /** |
245 /** |
249 */ |
251 */ |
250 echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) ); |
252 echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) ); |
251 } |
253 } |
252 |
254 |
253 /** |
255 /** |
254 * Outputs the link to the comments for the current post in an xml safe way |
256 * Outputs the link to the comments for the current post in an XML safe way. |
255 * |
257 * |
256 * @since 3.0.0 |
258 * @since 3.0.0 |
257 */ |
259 */ |
258 function comments_link_feed() { |
260 function comments_link_feed() { |
259 /** |
261 /** |
266 */ |
268 */ |
267 echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); |
269 echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); |
268 } |
270 } |
269 |
271 |
270 /** |
272 /** |
271 * Display the feed GUID for the current comment. |
273 * Displays the feed GUID for the current comment. |
272 * |
274 * |
273 * @since 2.5.0 |
275 * @since 2.5.0 |
274 * |
276 * |
275 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object. |
277 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object. |
276 */ |
278 */ |
277 function comment_guid( $comment_id = null ) { |
279 function comment_guid( $comment_id = null ) { |
278 echo esc_url( get_comment_guid( $comment_id ) ); |
280 echo esc_url( get_comment_guid( $comment_id ) ); |
279 } |
281 } |
280 |
282 |
281 /** |
283 /** |
282 * Retrieve the feed GUID for the current comment. |
284 * Retrieves the feed GUID for the current comment. |
283 * |
285 * |
284 * @since 2.5.0 |
286 * @since 2.5.0 |
285 * |
287 * |
286 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object. |
288 * @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object. |
287 * @return string|false GUID for comment on success, false on failure. |
289 * @return string|false GUID for comment on success, false on failure. |
295 |
297 |
296 return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; |
298 return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; |
297 } |
299 } |
298 |
300 |
299 /** |
301 /** |
300 * Display the link to the comments. |
302 * Displays the link to the comments. |
301 * |
303 * |
302 * @since 1.5.0 |
304 * @since 1.5.0 |
303 * @since 4.4.0 Introduced the `$comment` argument. |
305 * @since 4.4.0 Introduced the `$comment` argument. |
304 * |
306 * |
305 * @param int|WP_Comment $comment Optional. Comment object or ID. Defaults to global comment object. |
307 * @param int|WP_Comment $comment Optional. Comment object or ID. Defaults to global comment object. |
316 */ |
318 */ |
317 echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) ); |
319 echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) ); |
318 } |
320 } |
319 |
321 |
320 /** |
322 /** |
321 * Retrieve the current comment author for use in the feeds. |
323 * Retrieves the current comment author for use in the feeds. |
322 * |
324 * |
323 * @since 2.0.0 |
325 * @since 2.0.0 |
324 * |
326 * |
325 * @return string Comment Author |
327 * @return string Comment Author. |
326 */ |
328 */ |
327 function get_comment_author_rss() { |
329 function get_comment_author_rss() { |
328 /** |
330 /** |
329 * Filters the current comment author for use in a feed. |
331 * Filters the current comment author for use in a feed. |
330 * |
332 * |
336 */ |
338 */ |
337 return apply_filters( 'comment_author_rss', get_comment_author() ); |
339 return apply_filters( 'comment_author_rss', get_comment_author() ); |
338 } |
340 } |
339 |
341 |
340 /** |
342 /** |
341 * Display the current comment author in the feed. |
343 * Displays the current comment author in the feed. |
342 * |
344 * |
343 * @since 1.0.0 |
345 * @since 1.0.0 |
344 */ |
346 */ |
345 function comment_author_rss() { |
347 function comment_author_rss() { |
346 echo get_comment_author_rss(); |
348 echo get_comment_author_rss(); |
347 } |
349 } |
348 |
350 |
349 /** |
351 /** |
350 * Display the current comment content for use in the feeds. |
352 * Displays the current comment content for use in the feeds. |
351 * |
353 * |
352 * @since 1.0.0 |
354 * @since 1.0.0 |
353 */ |
355 */ |
354 function comment_text_rss() { |
356 function comment_text_rss() { |
355 $comment_text = get_comment_text(); |
357 $comment_text = get_comment_text(); |
363 $comment_text = apply_filters( 'comment_text_rss', $comment_text ); |
365 $comment_text = apply_filters( 'comment_text_rss', $comment_text ); |
364 echo $comment_text; |
366 echo $comment_text; |
365 } |
367 } |
366 |
368 |
367 /** |
369 /** |
368 * Retrieve all of the post categories, formatted for use in feeds. |
370 * Retrieves all of the post categories, formatted for use in feeds. |
369 * |
371 * |
370 * All of the categories for the current post in the feed loop, will be |
372 * All of the categories for the current post in the feed loop, will be |
371 * retrieved and have feed markup added, so that they can easily be added to the |
373 * retrieved and have feed markup added, so that they can easily be added to the |
372 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. |
374 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. |
373 * |
375 * |
425 */ |
427 */ |
426 return apply_filters( 'the_category_rss', $the_list, $type ); |
428 return apply_filters( 'the_category_rss', $the_list, $type ); |
427 } |
429 } |
428 |
430 |
429 /** |
431 /** |
430 * Display the post categories in the feed. |
432 * Displays the post categories in the feed. |
431 * |
433 * |
432 * @since 0.71 |
434 * @since 0.71 |
433 * |
435 * |
434 * @see get_the_category_rss() For better explanation. |
436 * @see get_the_category_rss() For better explanation. |
435 * |
437 * |
438 function the_category_rss( $type = null ) { |
440 function the_category_rss( $type = null ) { |
439 echo get_the_category_rss( $type ); |
441 echo get_the_category_rss( $type ); |
440 } |
442 } |
441 |
443 |
442 /** |
444 /** |
443 * Display the HTML type based on the blog setting. |
445 * Displays the HTML type based on the blog setting. |
444 * |
446 * |
445 * The two possible values are either 'xhtml' or 'html'. |
447 * The two possible values are either 'xhtml' or 'html'. |
446 * |
448 * |
447 * @since 2.2.0 |
449 * @since 2.2.0 |
448 */ |
450 */ |
449 function html_type_rss() { |
451 function html_type_rss() { |
450 $type = get_bloginfo( 'html_type' ); |
452 $type = get_bloginfo( 'html_type' ); |
451 if ( strpos( $type, 'xhtml' ) !== false ) { |
453 if ( str_contains( $type, 'xhtml' ) ) { |
452 $type = 'xhtml'; |
454 $type = 'xhtml'; |
453 } else { |
455 } else { |
454 $type = 'html'; |
456 $type = 'html'; |
455 } |
457 } |
456 echo $type; |
458 echo $type; |
457 } |
459 } |
458 |
460 |
459 /** |
461 /** |
460 * Display the rss enclosure for the current post. |
462 * Displays the rss enclosure for the current post. |
461 * |
463 * |
462 * Uses the global $post to check whether the post requires a password and if |
464 * Uses the global $post to check whether the post requires a password and if |
463 * the user has the password for the post. If not then it will return before |
465 * the user has the password for the post. If not then it will return before |
464 * displaying. |
466 * displaying. |
465 * |
467 * |
496 } |
498 } |
497 } |
499 } |
498 } |
500 } |
499 |
501 |
500 /** |
502 /** |
501 * Display the atom enclosure for the current post. |
503 * Displays the atom enclosure for the current post. |
502 * |
504 * |
503 * Uses the global $post to check whether the post requires a password and if |
505 * Uses the global $post to check whether the post requires a password and if |
504 * the user has the password for the post. If not then it will return before |
506 * the user has the password for the post. If not then it will return before |
505 * displaying. |
507 * displaying. |
506 * |
508 * |
561 } |
563 } |
562 } |
564 } |
563 } |
565 } |
564 |
566 |
565 /** |
567 /** |
566 * Determine the type of a string of data with the data formatted. |
568 * Determines the type of a string of data with the data formatted. |
567 * |
569 * |
568 * Tell whether the type is text, HTML, or XHTML, per RFC 4287 section 3.1. |
570 * Tell whether the type is text, HTML, or XHTML, per RFC 4287 section 3.1. |
569 * |
571 * |
570 * In the case of WordPress, text is defined as containing no markup, |
572 * In the case of WordPress, text is defined as containing no markup, |
571 * XHTML is defined as "well formed", and HTML as tag soup (i.e., the rest). |
573 * XHTML is defined as "well formed", and HTML as tag soup (i.e., the rest). |
574 * |
576 * |
575 * @link http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.3.1 |
577 * @link http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.3.1 |
576 * |
578 * |
577 * @since 2.5.0 |
579 * @since 2.5.0 |
578 * |
580 * |
579 * @param string $data Input string |
581 * @param string $data Input string. |
580 * @return array array(type, value) |
582 * @return array array(type, value) |
581 */ |
583 */ |
582 function prep_atom_text_construct( $data ) { |
584 function prep_atom_text_construct( $data ) { |
583 if ( strpos( $data, '<' ) === false && strpos( $data, '&' ) === false ) { |
585 if ( ! str_contains( $data, '<' ) && ! str_contains( $data, '&' ) ) { |
584 return array( 'text', $data ); |
586 return array( 'text', $data ); |
585 } |
587 } |
586 |
588 |
587 if ( ! function_exists( 'xml_parser_create' ) ) { |
589 if ( ! function_exists( 'xml_parser_create' ) ) { |
588 trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); |
590 wp_trigger_error( '', __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); |
589 |
591 |
590 return array( 'html', "<![CDATA[$data]]>" ); |
592 return array( 'html', "<![CDATA[$data]]>" ); |
591 } |
593 } |
592 |
594 |
593 $parser = xml_parser_create(); |
595 $parser = xml_parser_create(); |
595 $code = xml_get_error_code( $parser ); |
597 $code = xml_get_error_code( $parser ); |
596 xml_parser_free( $parser ); |
598 xml_parser_free( $parser ); |
597 unset( $parser ); |
599 unset( $parser ); |
598 |
600 |
599 if ( ! $code ) { |
601 if ( ! $code ) { |
600 if ( strpos( $data, '<' ) === false ) { |
602 if ( ! str_contains( $data, '<' ) ) { |
601 return array( 'text', $data ); |
603 return array( 'text', $data ); |
602 } else { |
604 } else { |
603 $data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>"; |
605 $data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>"; |
604 return array( 'xhtml', $data ); |
606 return array( 'xhtml', $data ); |
605 } |
607 } |
606 } |
608 } |
607 |
609 |
608 if ( strpos( $data, ']]>' ) === false ) { |
610 if ( ! str_contains( $data, ']]>' ) ) { |
609 return array( 'html', "<![CDATA[$data]]>" ); |
611 return array( 'html', "<![CDATA[$data]]>" ); |
610 } else { |
612 } else { |
611 return array( 'html', htmlspecialchars( $data ) ); |
613 return array( 'html', htmlspecialchars( $data ) ); |
612 } |
614 } |
613 } |
615 } |
656 * @since 5.3.0 |
658 * @since 5.3.0 |
657 * |
659 * |
658 * @return string Correct link for the atom:self element. |
660 * @return string Correct link for the atom:self element. |
659 */ |
661 */ |
660 function get_self_link() { |
662 function get_self_link() { |
661 $host = parse_url( home_url() ); |
663 $parsed = parse_url( home_url() ); |
662 return set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ); |
664 |
663 } |
665 $domain = $parsed['host']; |
664 |
666 if ( isset( $parsed['port'] ) ) { |
665 /** |
667 $domain .= ':' . $parsed['port']; |
666 * Display the link for the currently displayed feed in a XSS safe way. |
668 } |
|
669 |
|
670 return set_url_scheme( 'http://' . $domain . wp_unslash( $_SERVER['REQUEST_URI'] ) ); |
|
671 } |
|
672 |
|
673 /** |
|
674 * Displays the link for the currently displayed feed in a XSS safe way. |
667 * |
675 * |
668 * Generate a correct link for the atom:self element. |
676 * Generate a correct link for the atom:self element. |
669 * |
677 * |
670 * @since 2.5.0 |
678 * @since 2.5.0 |
671 */ |
679 */ |
682 */ |
690 */ |
683 echo esc_url( apply_filters( 'self_link', get_self_link() ) ); |
691 echo esc_url( apply_filters( 'self_link', get_self_link() ) ); |
684 } |
692 } |
685 |
693 |
686 /** |
694 /** |
687 * Get the UTC time of the most recently modified post from WP_Query. |
695 * Gets the UTC time of the most recently modified post from WP_Query. |
688 * |
696 * |
689 * If viewing a comment feed, the time of the most recently modified |
697 * If viewing a comment feed, the time of the most recently modified |
690 * comment will be returned. |
698 * comment will be returned. |
691 * |
699 * |
|
700 * @since 5.2.0 |
|
701 * |
692 * @global WP_Query $wp_query WordPress Query object. |
702 * @global WP_Query $wp_query WordPress Query object. |
693 * |
|
694 * @since 5.2.0 |
|
695 * |
703 * |
696 * @param string $format Date format string to return the time in. |
704 * @param string $format Date format string to return the time in. |
697 * @return string|false The time in requested format, or false on failure. |
705 * @return string|false The time in requested format, or false on failure. |
698 */ |
706 */ |
699 function get_feed_build_date( $format ) { |
707 function get_feed_build_date( $format ) { |
740 */ |
748 */ |
741 return apply_filters( 'get_feed_build_date', $max_modified_time, $format ); |
749 return apply_filters( 'get_feed_build_date', $max_modified_time, $format ); |
742 } |
750 } |
743 |
751 |
744 /** |
752 /** |
745 * Return the content type for specified feed type. |
753 * Returns the content type for specified feed type. |
746 * |
754 * |
747 * @since 2.8.0 |
755 * @since 2.8.0 |
748 * |
756 * |
749 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'. |
757 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'. |
|
758 * @return string Content type for specified feed type. |
750 */ |
759 */ |
751 function feed_content_type( $type = '' ) { |
760 function feed_content_type( $type = '' ) { |
752 if ( empty( $type ) ) { |
761 if ( empty( $type ) ) { |
753 $type = get_default_feed(); |
762 $type = get_default_feed(); |
754 } |
763 } |
773 */ |
782 */ |
774 return apply_filters( 'feed_content_type', $content_type, $type ); |
783 return apply_filters( 'feed_content_type', $content_type, $type ); |
775 } |
784 } |
776 |
785 |
777 /** |
786 /** |
778 * Build SimplePie object based on RSS or Atom feed from URL. |
787 * Builds SimplePie object based on RSS or Atom feed from URL. |
779 * |
788 * |
780 * @since 2.8.0 |
789 * @since 2.8.0 |
781 * |
790 * |
782 * @param string|string[] $url URL of feed to retrieve. If an array of URLs, the feeds are merged |
791 * @param string|string[] $url URL of feed to retrieve. If an array of URLs, the feeds are merged |
783 * using SimplePie's multifeed feature. |
792 * using SimplePie's multifeed feature. |
794 require_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php'; |
803 require_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php'; |
795 |
804 |
796 $feed = new SimplePie(); |
805 $feed = new SimplePie(); |
797 |
806 |
798 $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); |
807 $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); |
799 // We must manually overwrite $feed->sanitize because SimplePie's constructor |
808 /* |
800 // sets it before we have a chance to set the sanitization class. |
809 * We must manually overwrite $feed->sanitize because SimplePie's constructor |
|
810 * sets it before we have a chance to set the sanitization class. |
|
811 */ |
801 $feed->sanitize = new WP_SimplePie_Sanitize_KSES(); |
812 $feed->sanitize = new WP_SimplePie_Sanitize_KSES(); |
802 |
813 |
803 // Register the cache handler using the recommended method for SimplePie 1.3 or later. |
814 // Register the cache handler using the recommended method for SimplePie 1.3 or later. |
804 if ( method_exists( 'SimplePie_Cache', 'register' ) ) { |
815 if ( method_exists( 'SimplePie_Cache', 'register' ) ) { |
805 SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' ); |
816 SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' ); |