Source View: rss2_head

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
250      <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
251      <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
252      <wp:base_blog_url><?php bloginfo_rss('url'); ?></wp:base_blog_url>
253 <?php if ( $cats ) : foreach ( $cats as $c ) : ?>
254      <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
255 <?php endforeach; endif; ?>
256 <?php if ( $tags ) : foreach ( $tags as $t ) : ?>
257      <wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
258 <?php endforeach; endif; ?>
259      <?php do_action('rss2_head'); ?>
260      <?php if ($post_ids) {
261           global $wp_query;
262           $wp_query->in_the_loop = true;  // Fake being in the loop.
263           // fetch 20 posts at a time rather than loading the entire table into memory
264           while ( $next_posts = array_splice($post_ids, 0, 20) ) {
265                $where = "WHERE ID IN (".join(',', $next_posts).")";
266                $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
267                     foreach ($posts as $post) {
268                // Don't export revisions.  They bloat the export.