do_feed [ WordPress Function ]
do_feed ( No parameters )
| Uses: |
|
| Defined at: |
|
Loads the feed template from the use of an action hook.
If the feed action does not have a hook, then the function will die with a message telling the visitor that the feed is not valid.
It is better to only have one hook for each feed.
Source
<?php
function do_feed() {
global $wp_query;
$feed = get_query_var( 'feed' );
// Remove the pad, if present.
$feed = preg_replace( '/^_+/', '', $feed );
if ( $feed == '' || $feed == 'feed' )
$feed = get_default_feed();
$hook = 'do_feed_' . $feed;
if ( !has_action($hook) ) {
$message = sprintf( __( 'ERROR: %s is not a valid feed template.' ), esc_html($feed));
wp_die( $message, '', array( 'response' => 404 ) );
}
do_action( $hook, $wp_query->is_comment_feed );
}
?>
Examples [ wp-snippets.com ]
Top Google Search Results
- Function Reference/do feed « WordPress Codex
Description. Loads the feed template from the use of an action hook. If the feed action does not have a hook, then the function will die with a message telling the ...
codex.wordpress.org - Add custom feed to Wordpress: add_feed or do_feed - Stack Overflow
Relying on an undocumented method in any API is more dangerous than figuring out how to properly use a documented method.
stackoverflow.com - do_feed() WordPress function reference, arguments and source at ...
Loads the feed template from the use of an action hook.
queryposts.com - Feeding Your Worms
Do Feed Worms: Vegetable scraps; Fruit scraps and peels (mold/rot is fine); Bread and grains; Teabags; Non-greasy leftovers; Coffee grounds (and filters) ...
www.compostsantacruzcounty.org