14 * |
14 * |
15 * You can retrieve anything that you can using the get_bloginfo() function. |
15 * You can retrieve anything that you can using the get_bloginfo() function. |
16 * Everything will be stripped of tags and characters converted, when the values |
16 * Everything will be stripped of tags and characters converted, when the values |
17 * are retrieved for use in the feeds. |
17 * are retrieved for use in the feeds. |
18 * |
18 * |
19 * @package WordPress |
|
20 * @subpackage Feed |
|
21 * @since 1.5.1 |
19 * @since 1.5.1 |
22 * @uses apply_filters() Calls 'get_bloginfo_rss' hook with two parameters. |
|
23 * @see get_bloginfo() For the list of possible values to display. |
20 * @see get_bloginfo() For the list of possible values to display. |
24 * |
21 * |
25 * @param string $show See get_bloginfo() for possible values. |
22 * @param string $show See get_bloginfo() for possible values. |
26 * @return string |
23 * @return string |
27 */ |
24 */ |
28 function get_bloginfo_rss($show = '') { |
25 function get_bloginfo_rss($show = '') { |
29 $info = strip_tags(get_bloginfo($show)); |
26 $info = strip_tags(get_bloginfo($show)); |
30 return apply_filters('get_bloginfo_rss', convert_chars($info), $show); |
27 /** |
|
28 * Filter the bloginfo for use in RSS feeds. |
|
29 * |
|
30 * @since 2.2.0 |
|
31 * |
|
32 * @see convert_chars() |
|
33 * @see get_bloginfo() |
|
34 * |
|
35 * @param string $info Converted string value of the blog information. |
|
36 * @param string $show The type of blog information to retrieve. |
|
37 */ |
|
38 return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show ); |
31 } |
39 } |
32 |
40 |
33 /** |
41 /** |
34 * Display RSS container for the bloginfo function. |
42 * Display RSS container for the bloginfo function. |
35 * |
43 * |
36 * You can retrieve anything that you can using the get_bloginfo() function. |
44 * You can retrieve anything that you can using the get_bloginfo() function. |
37 * Everything will be stripped of tags and characters converted, when the values |
45 * Everything will be stripped of tags and characters converted, when the values |
38 * are retrieved for use in the feeds. |
46 * are retrieved for use in the feeds. |
39 * |
47 * |
40 * @package WordPress |
|
41 * @subpackage Feed |
|
42 * @since 0.71 |
48 * @since 0.71 |
43 * @uses apply_filters() Calls 'bloginfo_rss' hook with two parameters. |
|
44 * @see get_bloginfo() For the list of possible values to display. |
49 * @see get_bloginfo() For the list of possible values to display. |
45 * |
50 * |
46 * @param string $show See get_bloginfo() for possible values. |
51 * @param string $show See get_bloginfo() for possible values. |
47 */ |
52 */ |
48 function bloginfo_rss($show = '') { |
53 function bloginfo_rss($show = '') { |
49 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show); |
54 /** |
|
55 * Filter the bloginfo for display in RSS feeds. |
|
56 * |
|
57 * @since 2.1.0 |
|
58 * |
|
59 * @see get_bloginfo() |
|
60 * |
|
61 * @param string $rss_container RSS container for the blog information. |
|
62 * @param string $show The type of blog information to retrieve. |
|
63 */ |
|
64 echo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show ); |
50 } |
65 } |
51 |
66 |
52 /** |
67 /** |
53 * Retrieve the default feed. |
68 * Retrieve the default feed. |
54 * |
69 * |
55 * The default feed is 'rss2', unless a plugin changes it through the |
70 * The default feed is 'rss2', unless a plugin changes it through the |
56 * 'default_feed' filter. |
71 * 'default_feed' filter. |
57 * |
72 * |
58 * @package WordPress |
73 * @since 2.5.0 |
59 * @subpackage Feed |
|
60 * @since 2.5 |
|
61 * @uses apply_filters() Calls 'default_feed' hook on the default feed string. |
|
62 * |
74 * |
63 * @return string Default feed, or for example 'rss2', 'atom', etc. |
75 * @return string Default feed, or for example 'rss2', 'atom', etc. |
64 */ |
76 */ |
65 function get_default_feed() { |
77 function get_default_feed() { |
66 $default_feed = apply_filters('default_feed', 'rss2'); |
78 /** |
|
79 * Filter the default feed type. |
|
80 * |
|
81 * @since 2.5.0 |
|
82 * |
|
83 * @param string $feed_type Type of default feed. Possible values include 'rss2', 'atom'. |
|
84 * Default 'rss2'. |
|
85 */ |
|
86 $default_feed = apply_filters( 'default_feed', 'rss2' ); |
67 return 'rss' == $default_feed ? 'rss2' : $default_feed; |
87 return 'rss' == $default_feed ? 'rss2' : $default_feed; |
68 } |
88 } |
69 |
89 |
70 /** |
90 /** |
71 * Retrieve the blog title for the feed title. |
91 * Retrieve the blog title for the feed title. |
72 * |
92 * |
73 * @package WordPress |
|
74 * @subpackage Feed |
|
75 * @since 2.2.0 |
93 * @since 2.2.0 |
76 * @uses apply_filters() Calls 'get_wp_title_rss' hook on title. |
94 * |
77 * @uses wp_title() See function for $sep parameter usage. |
95 * @param string $sep Optional. How to separate the title. See wp_title() for more info. |
78 * |
|
79 * @param string $sep Optional.How to separate the title. See wp_title() for more info. |
|
80 * @return string Error message on failure or blog title on success. |
96 * @return string Error message on failure or blog title on success. |
81 */ |
97 */ |
82 function get_wp_title_rss($sep = '»') { |
98 function get_wp_title_rss( $sep = '»' ) { |
83 $title = wp_title($sep, false); |
99 $title = wp_title( $sep, false ); |
84 if ( is_wp_error( $title ) ) |
100 |
|
101 if ( is_wp_error( $title ) ) { |
85 return $title->get_error_message(); |
102 return $title->get_error_message(); |
|
103 } |
|
104 |
|
105 if ( $title && $sep && ' ' !== substr( $title, 0, 1 ) ) { |
|
106 $title = " $sep " . $title; |
|
107 } |
|
108 |
|
109 /** |
|
110 * Filter the blog title for use as the feed title. |
|
111 * |
|
112 * @since 2.2.0 |
|
113 * |
|
114 * @param string $title The current blog title. |
|
115 * @param string $sep Separator used by wp_title(). |
|
116 */ |
86 $title = apply_filters( 'get_wp_title_rss', $title, $sep ); |
117 $title = apply_filters( 'get_wp_title_rss', $title, $sep ); |
87 return $title; |
118 return $title; |
88 } |
119 } |
89 |
120 |
90 /** |
121 /** |
91 * Display the blog title for display of the feed title. |
122 * Display the blog title for display of the feed title. |
92 * |
123 * |
93 * @package WordPress |
|
94 * @subpackage Feed |
|
95 * @since 2.2.0 |
124 * @since 2.2.0 |
96 * @uses apply_filters() Calls 'wp_title_rss' on the blog title. |
|
97 * @see wp_title() $sep parameter usage. |
125 * @see wp_title() $sep parameter usage. |
98 * |
126 * |
99 * @param string $sep Optional. |
127 * @param string $sep Optional. |
100 */ |
128 */ |
101 function wp_title_rss( $sep = '»' ) { |
129 function wp_title_rss( $sep = '»' ) { |
|
130 /** |
|
131 * Filter the blog title for display of the feed title. |
|
132 * |
|
133 * @since 2.2.0 |
|
134 * |
|
135 * @see get_wp_title_rss() |
|
136 * |
|
137 * @param string $wp_title The current blog title. |
|
138 * @param string $sep Separator used by wp_title(). |
|
139 */ |
102 echo apply_filters( 'wp_title_rss', get_wp_title_rss( $sep ), $sep ); |
140 echo apply_filters( 'wp_title_rss', get_wp_title_rss( $sep ), $sep ); |
103 } |
141 } |
104 |
142 |
105 /** |
143 /** |
106 * Retrieve the current post title for the feed. |
144 * Retrieve the current post title for the feed. |
107 * |
145 * |
108 * @package WordPress |
|
109 * @subpackage Feed |
|
110 * @since 2.0.0 |
146 * @since 2.0.0 |
111 * @uses apply_filters() Calls 'the_title_rss' on the post title. |
|
112 * |
147 * |
113 * @return string Current post title. |
148 * @return string Current post title. |
114 */ |
149 */ |
115 function get_the_title_rss() { |
150 function get_the_title_rss() { |
116 $title = get_the_title(); |
151 $title = get_the_title(); |
117 $title = apply_filters('the_title_rss', $title); |
152 /** |
|
153 * Filter the post title for use in a feed. |
|
154 * |
|
155 * @since 1.2.0 |
|
156 * |
|
157 * @param string $title The current post title. |
|
158 */ |
|
159 $title = apply_filters( 'the_title_rss', $title ); |
118 return $title; |
160 return $title; |
119 } |
161 } |
120 |
162 |
121 /** |
163 /** |
122 * Display the post title in the feed. |
164 * Display the post title in the feed. |
123 * |
165 * |
124 * @package WordPress |
|
125 * @subpackage Feed |
|
126 * @since 0.71 |
166 * @since 0.71 |
127 * @uses get_the_title_rss() Used to retrieve current post title. |
|
128 */ |
167 */ |
129 function the_title_rss() { |
168 function the_title_rss() { |
130 echo get_the_title_rss(); |
169 echo get_the_title_rss(); |
131 } |
170 } |
132 |
171 |
133 /** |
172 /** |
134 * Retrieve the post content for feeds. |
173 * Retrieve the post content for feeds. |
135 * |
174 * |
136 * @package WordPress |
|
137 * @subpackage Feed |
|
138 * @since 2.9.0 |
175 * @since 2.9.0 |
139 * @uses apply_filters() Calls 'the_content_feed' on the content before processing. |
|
140 * @see get_the_content() |
176 * @see get_the_content() |
141 * |
177 * |
142 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
178 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
143 * @return string The filtered content. |
179 * @return string The filtered content. |
144 */ |
180 */ |
145 function get_the_content_feed($feed_type = null) { |
181 function get_the_content_feed($feed_type = null) { |
146 if ( !$feed_type ) |
182 if ( !$feed_type ) |
147 $feed_type = get_default_feed(); |
183 $feed_type = get_default_feed(); |
148 |
184 |
149 $content = apply_filters('the_content', get_the_content()); |
185 /** This filter is documented in wp-includes/post-template.php */ |
|
186 $content = apply_filters( 'the_content', get_the_content() ); |
150 $content = str_replace(']]>', ']]>', $content); |
187 $content = str_replace(']]>', ']]>', $content); |
151 return apply_filters('the_content_feed', $content, $feed_type); |
188 /** |
|
189 * Filter the post content for use in feeds. |
|
190 * |
|
191 * @since 2.9.0 |
|
192 * |
|
193 * @param string $content The current post content. |
|
194 * @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'. |
|
195 * Default 'rss2'. |
|
196 */ |
|
197 return apply_filters( 'the_content_feed', $content, $feed_type ); |
152 } |
198 } |
153 |
199 |
154 /** |
200 /** |
155 * Display the post content for feeds. |
201 * Display the post content for feeds. |
156 * |
202 * |
157 * @package WordPress |
|
158 * @subpackage Feed |
|
159 * @since 2.9.0 |
203 * @since 2.9.0 |
160 * @uses apply_filters() Calls 'the_content_feed' on the content before processing. |
|
161 * @see get_the_content() |
|
162 * |
204 * |
163 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
205 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf |
164 */ |
206 */ |
165 function the_content_feed($feed_type = null) { |
207 function the_content_feed($feed_type = null) { |
166 echo get_the_content_feed($feed_type); |
208 echo get_the_content_feed($feed_type); |
167 } |
209 } |
168 |
210 |
169 /** |
211 /** |
170 * Display the post excerpt for the feed. |
212 * Display the post excerpt for the feed. |
171 * |
213 * |
172 * @package WordPress |
|
173 * @subpackage Feed |
|
174 * @since 0.71 |
214 * @since 0.71 |
175 * @uses apply_filters() Calls 'the_excerpt_rss' hook on the excerpt. |
|
176 */ |
215 */ |
177 function the_excerpt_rss() { |
216 function the_excerpt_rss() { |
178 $output = get_the_excerpt(); |
217 $output = get_the_excerpt(); |
179 echo apply_filters('the_excerpt_rss', $output); |
218 /** |
|
219 * Filter the post excerpt for a feed. |
|
220 * |
|
221 * @since 1.2.0 |
|
222 * |
|
223 * @param string $output The current post excerpt. |
|
224 */ |
|
225 echo apply_filters( 'the_excerpt_rss', $output ); |
180 } |
226 } |
181 |
227 |
182 /** |
228 /** |
183 * Display the permalink to the post for use in feeds. |
229 * Display the permalink to the post for use in feeds. |
184 * |
230 * |
185 * @package WordPress |
|
186 * @subpackage Feed |
|
187 * @since 2.3.0 |
231 * @since 2.3.0 |
188 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink |
|
189 */ |
232 */ |
190 function the_permalink_rss() { |
233 function the_permalink_rss() { |
191 echo esc_url( apply_filters('the_permalink_rss', get_permalink() )); |
234 /** |
|
235 * Filter the permalink to the post for use in feeds. |
|
236 * |
|
237 * @since 2.3.0 |
|
238 * |
|
239 * @param string $post_permalink The current post permalink. |
|
240 */ |
|
241 echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) ); |
192 } |
242 } |
193 |
243 |
194 /** |
244 /** |
195 * Outputs the link to the comments for the current post in an xml safe way |
245 * Outputs the link to the comments for the current post in an xml safe way |
196 * |
246 * |
197 * @since 3.0.0 |
247 * @since 3.0.0 |
198 * @return none |
248 * @return none |
199 */ |
249 */ |
200 function comments_link_feed() { |
250 function comments_link_feed() { |
|
251 /** |
|
252 * Filter the comments permalink for the current post. |
|
253 * |
|
254 * @since 3.6.0 |
|
255 * |
|
256 * @param string $comment_permalink The current comment permalink with |
|
257 * '#comments' appended. |
|
258 */ |
201 echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); |
259 echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); |
202 } |
260 } |
203 |
261 |
204 /** |
262 /** |
205 * Display the feed GUID for the current comment. |
263 * Display the feed GUID for the current comment. |
206 * |
264 * |
207 * @package WordPress |
|
208 * @subpackage Feed |
|
209 * @since 2.5.0 |
265 * @since 2.5.0 |
210 * |
266 * |
211 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. |
267 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. |
212 */ |
268 */ |
213 function comment_guid($comment_id = null) { |
269 function comment_guid($comment_id = null) { |
237 * Display the link to the comments. |
291 * Display the link to the comments. |
238 * |
292 * |
239 * @since 1.5.0 |
293 * @since 1.5.0 |
240 */ |
294 */ |
241 function comment_link() { |
295 function comment_link() { |
|
296 /** |
|
297 * Filter the current comment's permalink. |
|
298 * |
|
299 * @since 3.6.0 |
|
300 * |
|
301 * @see get_comment_link() |
|
302 * |
|
303 * @param string $comment_permalink The current comment permalink. |
|
304 */ |
242 echo esc_url( apply_filters( 'comment_link', get_comment_link() ) ); |
305 echo esc_url( apply_filters( 'comment_link', get_comment_link() ) ); |
243 } |
306 } |
244 |
307 |
245 /** |
308 /** |
246 * Retrieve the current comment author for use in the feeds. |
309 * Retrieve the current comment author for use in the feeds. |
247 * |
310 * |
248 * @package WordPress |
|
249 * @subpackage Feed |
|
250 * @since 2.0.0 |
311 * @since 2.0.0 |
251 * @uses apply_filters() Calls 'comment_author_rss' hook on comment author. |
|
252 * @uses get_comment_author() |
|
253 * |
312 * |
254 * @return string Comment Author |
313 * @return string Comment Author |
255 */ |
314 */ |
256 function get_comment_author_rss() { |
315 function get_comment_author_rss() { |
257 return apply_filters('comment_author_rss', get_comment_author() ); |
316 /** |
|
317 * Filter the current comment author for use in a feed. |
|
318 * |
|
319 * @since 1.5.0 |
|
320 * |
|
321 * @see get_comment_author() |
|
322 * |
|
323 * @param string $comment_author The current comment author. |
|
324 */ |
|
325 return apply_filters( 'comment_author_rss', get_comment_author() ); |
258 } |
326 } |
259 |
327 |
260 /** |
328 /** |
261 * Display the current comment author in the feed. |
329 * Display the current comment author in the feed. |
262 * |
330 * |
263 * @package WordPress |
|
264 * @subpackage Feed |
|
265 * @since 1.0.0 |
331 * @since 1.0.0 |
266 */ |
332 */ |
267 function comment_author_rss() { |
333 function comment_author_rss() { |
268 echo get_comment_author_rss(); |
334 echo get_comment_author_rss(); |
269 } |
335 } |
270 |
336 |
271 /** |
337 /** |
272 * Display the current comment content for use in the feeds. |
338 * Display the current comment content for use in the feeds. |
273 * |
339 * |
274 * @package WordPress |
|
275 * @subpackage Feed |
|
276 * @since 1.0.0 |
340 * @since 1.0.0 |
277 * @uses apply_filters() Calls 'comment_text_rss' filter on comment content. |
|
278 * @uses get_comment_text() |
|
279 */ |
341 */ |
280 function comment_text_rss() { |
342 function comment_text_rss() { |
281 $comment_text = get_comment_text(); |
343 $comment_text = get_comment_text(); |
282 $comment_text = apply_filters('comment_text_rss', $comment_text); |
344 /** |
|
345 * Filter the current comment content for use in a feed. |
|
346 * |
|
347 * @since 1.5.0 |
|
348 * |
|
349 * @param string $comment_text The content of the current comment. |
|
350 */ |
|
351 $comment_text = apply_filters( 'comment_text_rss', $comment_text ); |
283 echo $comment_text; |
352 echo $comment_text; |
284 } |
353 } |
285 |
354 |
286 /** |
355 /** |
287 * Retrieve all of the post categories, formatted for use in feeds. |
356 * Retrieve all of the post categories, formatted for use in feeds. |
288 * |
357 * |
289 * All of the categories for the current post in the feed loop, will be |
358 * All of the categories for the current post in the feed loop, will be |
290 * retrieved and have feed markup added, so that they can easily be added to the |
359 * retrieved and have feed markup added, so that they can easily be added to the |
291 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. |
360 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. |
292 * |
361 * |
293 * @package WordPress |
|
294 * @subpackage Feed |
|
295 * @since 2.1.0 |
362 * @since 2.1.0 |
296 * @uses apply_filters() |
|
297 * |
363 * |
298 * @param string $type Optional, default is the type returned by get_default_feed(). |
364 * @param string $type Optional, default is the type returned by get_default_feed(). |
299 * @return string All of the post categories for displaying in the feed. |
365 * @return string All of the post categories for displaying in the feed. |
300 */ |
366 */ |
301 function get_the_category_rss($type = null) { |
367 function get_the_category_rss($type = null) { |